Open ekapasha17 opened 6 years ago
This workground works for me. https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15960#issuecomment-346645559
@changtimwu solved,I added "types": ["react", "react-native", "jest"] to my tsconfig but I still dont understand,what it does,maybe you can explain it ("types": ["react", "react-native", "jest"])
Adding "types" to tsconfig.json didn't work for me
Edit: because I didn't know you're supposed to add them under "compilerOptions"...
{
"compilerOptions": {
"types": ["react", "react-native", "jest"],
// ...
}
}
@savovs, Nice catch, that helped me a lot.
Unfortunately, when the compiler skips node, I still get errors, my project has dependencies on both node and react-native. Has there been any progress on this? Or are node and react-native mutually exclusive?
I am having same issue: as @stewhi added stackoverflow question.
When I remove the node types it gives me a lot of errors...
Adding "types" to tsconfig.json didn't work for me
Edit: because I didn't know you're supposed to add them under "compilerOptions"...
{ "compilerOptions": { "types": ["react", "react-native", "jest"], // ... } }
For me, all I needed was:
{
"compilerOptions": {
"types": ["react"],
// ...
}
}
... but this was a life saver!
I got several error when I following this guide and there's error about jsx : error TS2604: JSX element type 'Index' does not have any construct or call signatures
![image](https://user-images.githubusercontent.com/8170047/34341286-3c8a9a7c-e9c7-11e7-9f09-0fb6f3779c21.png)