3

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

3
  • Did you install @types/react-select? Commented Oct 3, 2020 at 16:23
  • everything is installed. Commented Oct 4, 2020 at 17:03
  • 2
    Did you ever solve this one? Commented Dec 30, 2020 at 22:03

1 Answer 1

-1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Do you mean you used import AsyncSelect from '@types/react-select/async';? Because that does not work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.