Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update types in types/index.d.ts #869

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

hpello
Copy link

@hpello hpello commented Feb 15, 2023

Description

The current types trigger an error:

node_modules/react-sortable-hoc/types/index.d.ts:108:11 - error TS2694: Namespace 'React' has no exported member 'SFC'.

108   | React.SFC<P>
              ~~~

Indeed, React.StatelessComponent has been removed from the react types (see https://stackoverflow.com/questions/44375759/how-should-i-declare-a-stateless-functional-component-with-typescript-in-react)

This PR fixes this error.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 15, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 464d3ad:

Sandbox Source
react-sortable-hoc-starter Configuration

React.StatelessComponent has been removed from the react types (see https://stackoverflow.com/questions/44375759/how-should-i-declare-a-stateless-functional-component-with-typescript-in-react)

The current types trigger an error:
```
node_modules/react-sortable-hoc/types/index.d.ts:108:11 - error TS2694: Namespace 'React' has no exported member 'SFC'.

108   | React.SFC<P>
```
@hpello
Copy link
Author

hpello commented Feb 21, 2023

Hello @clauderic! Could you take a look at this PR? 🙂
We need it to keep using react-sortable-hoc in our TS codebase.

@ErikBrendel
Copy link

I also just stumbled across this problem.

(Explicitly passing the prop type to SortableElement<P> and SortableContainer<P> helps as a workaround)

Having this update would still be nice though!

@hpello
Copy link
Author

hpello commented Sep 11, 2023

Hi @clauderic, any chance you can have a look at this PR? 🙂

  • For users with skipLibCheck: false, it will allow using this library
  • For users with skipLibCheck: true, it will catch misuses of the library! Else component props are typed as any 😞

🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants