I was working on a react-native project (not using typescript). All of a sudden I noticed I could not use react native APIs with auto-completion. When hovering over react native import get the warning "Could not find a declaration file for module ‘react-native’ ../node_modules/react-native/index.js’ implicitly has an ‘any’ type. Try npm i --save-dev @types/react-native
if it exists or add a new declaration (.d.ts) file containing declare module 'react-native';
". once again I’m not using typescript
P.S: I forgot to mention that I’m using expo sdk 44
2
Answers
That error is very common, and can mean a huge variety of things. One thing it never is – is anything that has to do with Typescript. That’s a big red-herring and don’t waste your time searching for a solution in regards to that.
I’d suggest a full restart and cleaning of your project, and then the error messages are usually more specific. So clear your cache, restart your computer, delete node_modules and then npm install again.
I had the same issue and the cause was due to this syntax error of 2
className
property tags on an element, in another component file of my app, see below: