I have problem with writing in TypeScript & ReactJS. I have no idea how to import external libraries and use them properly in the code.
I'm trying to use react-autosuggest
in my project so I'm:
- Installing
react-autosuggest
withnpm install --save react-autosuggest
- Installing typing for this library with
typings install --global --save dt~react-autosuggest
- going to file where I want to use this and trying to import that and use
Here I have problem, because I still have problems with importing it.
When I'm trying to import it with import * as autosuggest from 'react-autosuggest'
I'm getting error
error TS2497: Module ''react-autosuggest'' resolves to a non-module entity and cannot be imported using this construct.
When I'm importing with import Autosuggest from 'react-autosuggest'
another error appears:
error TS1192: Module ''react-autosuggest'' has no default export.
Could you guide me how to do it?