Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native - "react-native-interface.js" - WebStorm

For react-native - WebStorm users:

I'm starting a project with React Native using Jet Brains IDE WebStorm.

On project => node_modules/react-native/Libraries/react-native/react-native-interface.js

IDE get syntax errors:

react-native-interface.js syntax error print .jpg

Am I missing some library or plugin?

like image 400
Lothav Avatar asked Jun 27 '16 17:06

Lothav


1 Answers

You are seeing the syntax error because WebStorm thinks the file is regular JS. However, it's actually written in Flow.

Flow eventually gets transformed into JS, similar to TypeScript. Learn more about Flow here: https://flowtype.org/

Honestly, don't worry about it unless you messing with the core files (which you shouldn't unless you're fixing bugs).

I know it's annoying to have the red squiggly lines in your project. You can just close your project and reopen it. This will remove the red squiggly lines!

If you want to enable Flow syntax, follow these steps: https://www.jetbrains.com/help/webstorm/2016.2/using-the-flow-type-checker.html

EDIT: A quicker hack to get the lines removed is to close the file with the error. Right click it in the project view, mark it as plain text, then remark it as a JS file. Voila! Just make sure to not open file otherwise repeat the steps. lol

like image 123
hellojebus Avatar answered Sep 28 '22 08:09

hellojebus