Issue
I do the terminalcommand npx react-native init myapp
. Change the dir to /myapp and vs code shows me this problem warning:
There are some more Errors like this in the file, without doing anything.
What did I miss?
Solution
As discussed in the comments, this is a VSCode error only, since the application is using TypeScript
annotations and the default file extension for typescript files is .ts
. It could be solved by changing the file extension to .ts
and possibly change occurrences of App.js
in the project to App.ts
.
However, this error message does not effect the runtime behavior. Since it might be desired to not change any code, we can get rid of the error message by changing the VSCode settings.
This is done by setting "javascript.validate.enable": false
.
Answered By - David Scholz
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.