react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

Update types in types/index.d.ts

Open hpello opened this issue 2 years ago • 4 comments

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.

hpello avatar Feb 15 '23 16:02 hpello

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

codesandbox-ci[bot] avatar Feb 15 '23 16:02 codesandbox-ci[bot]

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

hpello avatar Feb 21 '23 10:02 hpello

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!

ErikBrendel avatar May 12 '23 12:05 ErikBrendel

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 😞

🙏

hpello avatar Sep 11 '23 09:09 hpello