Skip to content

Use React.FC instead of React.SFC due to removal in React v18 #38

Description

@ckknight

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-js-pull-to-refresh@1.3.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
index 5921dc8..28d6767 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
@@ -4,4 +4,4 @@ export interface PullDownContentProps {
     background?: any;
     label?: string;
 }
-export declare const PullDownContent: React.SFC<PullDownContentProps>;
+export declare const PullDownContent: React.FC<PullDownContentProps>;
diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
index c7e1b03..edf61b1 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
@@ -3,4 +3,4 @@ export interface RefreshContentProps {
     height?: string;
     background?: any;
 }
-export declare const RefreshContent: React.SFC<RefreshContentProps>;
+export declare const RefreshContent: React.FC<RefreshContentProps>;
diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
index 8310fbd..5c928a6 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
@@ -4,4 +4,4 @@ export interface ReleaseContentProps {
     background?: any;
     label?: string;
 }
-export declare const ReleaseContent: React.SFC<ReleaseContentProps>;
+export declare const ReleaseContent: React.FC<ReleaseContentProps>;

This issue body was partially generated by patch-package.


the above diff is for the dist/, but the solution should be a matter of just find-replacing React.SFC with React.FC.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions