Webstorm 11 doesn't recognize react

I just upgraded to WS 11.  Now when i open the react project I was working on in 10, it tells me that props and state are Unresolved variables.  I've already set the Javascript language version to JSX Harmony.  I have the same plugins and JavaScript Libraries loaded as I had in 10.  All of the files are the same.  I have no problem with this project in WS 10.  Has anyone else had this problem?

1
12 comments

can you provide exact code snippet that shows up the issue? Do you have react node_modules available in your project?

0
Avatar
Permanently deleted user

The exact code is something as simple as    show={this.state.showColumnManager}

State is underlined with "Undefined variable state" in the pop up.  What do you mean node_modules?  I can open the same project(same files) in WS 10 without any problem.  All of the JavaScript libraries are there.

0

No, sorry, this is not enough. I need to see a way things are defined, as you can create your components in a dozen of different way, using pure javascript, ES6, Typescript, with react node module used as a library, or with standalone react.js, etc.

0
Avatar
Permanently deleted user

I'm using pure JavaScript with a standalone react.js  I have to support ie 10.  The react.js file is downloaded and in a project folder.  It is referenced with the correct path in the index.html.

0

works for me using similar setup:

 

Please try invalidating caches - does the problem persist? If yes, try creating a sample project that shows up your issue

0
Avatar
Permanently deleted user

Do I have to use .jsx files?  All of my files are still .js files.

0

No, you don't need using .jsx extension. Just make sure to set Javascript language version to 'JSX Harmony'

0
Avatar
Permanently deleted user

We are using JSX Harmony.  And we are using react 0.13.3.  If we add this file "react-0.13.3.d.ts" to our Languages & Frameworks | JavaScript | Libraries, do you think this will fix the issue?  If not any suggestions you have would be helpful.

0

you can try... As I have mentioned, this works for me without .d.ts files. Just tried with react-0.13.3.js - same result.

0
Avatar
Permanently deleted user

I just upgraded to Webstorm 2016.  I still have the same issue.  What are your settings?  What plugins are you using?

0

Nothing special - no libraries configured, react-0.13.3.js is placed in the project directory

0
Avatar
Permanently deleted user

I've just run across this issue and resolved it by doing the following:

Settings -> Languages & Frameworks -> TypeScript -> Tick "Use TypeScript Service".

On version 2017.1.1

1

Please sign in to leave a comment.