sickdyd / react-search-autocomplete

A search box that filters the provided array of objects
https://sickdyd.github.io/react-search-autocomplete
MIT License
218 stars 82 forks source link

Library seems not supported to be used in ts project, no declaration module. #69

Closed fidellr closed 2 years ago

fidellr commented 2 years ago

Describe the bug Not supporting ts project, no declaration module was provided by the library, and block development to use inside ts project

Codesandbox example Create a codesandbox example with the problem you would like to have solved.

To Reproduce Steps to reproduce the behavior:

  1. Install library with yarn
  2. Import inside tsx file
  3. See error Could not find a declaration file for module 'react-search-autocomplete'. 'E:/xxx/node_modules/react-search-autocomplete/dist/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/react-search-autocomplete` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-search-autocomplete';

Expected behavior Suppport to be use in ts project

gignupg commented 2 years ago

Same issue here!

sickdyd commented 2 years ago

@fidellr Thank you for reporting this issue! I will try to take a look at it over the weekend.

sickdyd commented 2 years ago

@fidellr @gignupg I fixed the issue, install the latest version and it should work as expected!

https://github.com/sickdyd/react-search-autocomplete/commit/2f2b253201529e8be8e4602548df7330b8c65192