pqina / react-filepond

🔌 A handy FilePond adapter component for React
https://pqina.nl/filepond
MIT License
1.86k stars 90 forks source link

[Bug] Typescript error on latest react version #212

Closed Rocinante89 closed 2 years ago

Rocinante89 commented 2 years ago

Is there an existing issue for this?

Have you updated React FilePond, FilePond, and all plugins?

Describe the bug

I'm getting the following typescript errors when trying to use filepond in a remix typescript application:

JSX element class does not support attributes because it does not have a 'props' property.

'FilePond' cannot be used as a JSX component. Its instance type 'FilePond' is not a valid JSX element. Type 'FilePond' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.

Reproduction

Have a working repro here: https://codesandbox.io/s/vigilant-beaver-0or7bu?file=/app/routes/index.tsx

Environment

- Device: Macbook pro
- OS:latest
- Browser: chrome
- React version: 18.1.0
rikschennink commented 2 years ago

You're importing the vanilla JavaScript library instead of the React component.

Rocinante89 commented 2 years ago

🤦‍♂️