I cannot get PhpStorm to recognize "react-jsx"

My tsconfig.json has the property

"jsx": "react-jsx",

PhpStorm doesn't seem to recognize any JSX syntax. The same codebase works correclty under VSCode.

Is there a way to make PhpStorm to recognize this property?

If I change it to "react", I get other errors such as not using that old "import * as React from 'react'".

0
3 comments

Could you please provide some examples/screenshots showing the unrecognized syntax?

0

I'm sending screenshots of the errors I get when "jsx" is set to either "react" or "react-jsx" on tsconfig.json. It looks like phpstorm isn't recognizing "react-jsx" at all.

"jsx": "react",

"jsx": "react-jsx",

 

0

I figured it out. The project has other folders with package.json, and phpstorm was using typescript from the wrong folder. I don't see the error anymore with "react-jsx".

0

Please sign in to leave a comment.