Could not find a declaration file for module 'react-select/async'

Viewed 428

I've installed react-select 3.1.0 but when i try to import this file as defined in documentation it's giving me error.

TypeScript error in /home/.../src/core/components/kiosk/Component_file.tsx(3,25): Could not find a declaration file for module 'react-select/async'. '/home/.../node_modules/react-select/async/dist/react-select.cjs.js' implicitly has an 'any' type. TS7016

import code line:

import AsyncSelect from 'react-select/async';

Thank you advance for solving my problem

1 Answers

As i was working in typescript. I just changed package path. I prefix it with @types.

@types/react-select/async

You can see @types directory in node_modules.

Related