0

My WebStorm keeps treating any JSX code as XML which then results in dozens of unwanted inspection errors, see screenshots.

enter image description here

Also it keeps saying "Unresolved variable or function" for most of the object keys in files, for example for props keys in ReactJS etc.

enter image description here enter image description here enter image description here

Plus other inspection warnings I have no idea how to fix.

enter image description here enter image description here

I've never had these problems on my old Macbook, but this is a fresh install of WebStorm and its causing me headaches.

Thanks for any help

Felix Kling
  • 795,719
  • 175
  • 1,089
  • 1,143
Foxhoundn
  • 1,766
  • 2
  • 13
  • 19
  • Here's an issue related to the unresolved properties: https://youtrack.jetbrains.com/issue/WEB-20884 Please follow the updates on that. How Item and Control are exported in components/dropdown? What testing framework do you use? Adding a TypeScript definition file for it via Preferences | Languages and Frameworks | JavaScript | Library - Download should solve the issue with the warnings for `describe`. – Ekaterina Prigara Apr 04 '16 at 14:35

1 Answers1

2

You need to enable JSX harmony. Most of the time webstorm proposes it to you automatically when you work with react, but you can set it manually in the options.

Go to Preferences > Language & Frameworks > Javascript and then switch Javascript language version to JSX Harmony

enter image description here

Harijoe
  • 1,771
  • 1
  • 16
  • 27