tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
676 stars 147 forks source link

Implement with Typescript #68

Closed hendiche closed 4 years ago

hendiche commented 4 years ago

Hi, when I tried react-select is a bit complicated for me and looks like a big bundled. So I searched this package and try it, but I have problem in typing of Typescript. I would like to ask is there's any support for Typescript?

Error:(.., ..) TS7016: Could not find a declaration file for module 'react-select-search'. '../node_modules/react-select-search/dist/index.js' implicitly has an 'any' type.
  Try `npm install @types/react-select-search` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-select-search';`

package.json

...
"react": "^16.8.6",
"react-select-search": "^0.10.2",
...

I'm sorry I'm still beginner

tbleckert commented 4 years ago

Hi!

I haven't implemented declarations yet. Meanwhile you should be able to bypass the error by adding:

declare module 'react-select-search';

To a global.d.ts file in your project root.