could not find a declaration file for module in react project
//First try ( works for most of the cases)
npm install @types/module-name
//if that does not solve your problem than . (will surely solve your problem)
Inside the project create a folder called @types and added it to
tsconfig.json for find all required types from it . So it looks somewhat
like this -
"typeRoots": [
"../node_modules/@types",
"../@types"
]
And inside @types folder create a file called alltypes.d.ts .To find the unknown
types from it . so for me these were the unknown types and I added it over there.
declare module 'react';
declate module 'react-dom' ;
So now the typescript didn't complain about the types not found anymore .
Also in JavaScript:
- jquery selected option text
- loopback UserModel.setter.password overwrite
- text align-center js
- react tooltip on disabled button
- best way to learn js
- how to appendChild in the begin of the div javascript
- get first element by class name jquery
- jquery move element
- react-router react-router-dom
- animation library react
- what is ajax call
- hot loading react native shortcut key
- ajax jquery datatable display records with pagination in laravel
- node closes once you open app react-native
- how to create a new react native project
- webpack test js or jsx
- react datetime mannual editing
- ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: ENOENT: no such file or directory, scandir
- js call and apply
- how do i call a js method?
- react redirect after login
- location.reload sweetalert
- email validation in javascript
- How to replace an array vue.js