TypeScript and React JSX


I'm trying to configure TypeScript with React JSX and so far I created valid compilation configuration, but I have problem with syntax highlighting. When I write my file I use TypeScript syntax so I give file extension *.ts. Thanks to this TypeScript specific parts of code are interpreted correctly, but in this class I have also React JSX which gets highlighted and treated as inccorrect syntax by Intellij. If I change file extension to *.jsx, than JSX is ok (although I doesn't get autocompletion) but my TypeScript syntax gets highlighted.
How can I configure IntelliJ or WebStorm to treat such file correctly?

I attached screenshots of both cases, "typescript.png" shows file with "*.ts" extension and "jsx.png" shows file with "*.jsx" extension.

1 comment
Comment actions Permalink

There is no way to configure this currently. Please vote for https://youtrack.jetbrains.com/issue/WEB-14441


Please sign in to leave a comment.