0
votes

I import 'react-number-picker' but I can't find module. This is error:

Could not find a declaration file for module 'react-number-picker'. 'c:/Users/ADMIN/Documents/programacion-3-2019-arias/cliente/node_modules/react-number-picker/dist/react-number-picker.js' implicitly has an 'any' type. Try npm install @types/react-number-picker if it exists or add a new declaration (.d.ts) file containing declare module 'react-number-picker';ts(7016)

Anyone has got same problem as me?

1
I can think about running npm install @types/react-number-picker first from the error message. Can you clarify if you did that before? Thanks!norbitrial
I've tried about everything; putting import react-number-picker/src or copying NumberPicker.jsx and pasting in react-number-picker/dist but I'm getting same error.Francisco Arias
Yes. I did that before. But it not works. I put on the log "npm install @types/react-number-picker" but I'm getting same errorFrancisco Arias

1 Answers

0
votes

Go to your tsconfig.json file and under compilerOptions add this line "noImplicitAny": false. If it is set to true change it to false. This makes sure to allow imports for non typed third party libraries.

"compilerOptions": {
 ...other options here
"noImplicitAny": false
 },