clauderic / react-sortable-hoc

A set of higher-order components to turn any list into an animated, accessible and touch-friendly sortable list✌️
https://clauderic.github.io/react-sortable-hoc/
MIT License
10.81k stars 979 forks source link

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

Open hpello opened 1 year ago

hpello commented 1 year ago

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[bot] commented 1 year ago

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 464d3ad19688cc6e5997246599b0ea9f889063c9:

Sandbox Source
react-sortable-hoc-starter Configuration
hpello commented 1 year ago

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

ErikBrendel commented 1 year ago

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 commented 1 year ago

Hi @clauderic, any chance you can have a look at this PR? πŸ™‚

πŸ™