Typescript & React.JS

Fixed: Cannot use JSX unless the ‘–jsx’ flag is provided

Reading Time: 2 minutes. This blog post is about fixing issues related to building a project with TypeScript files. Basically, if your jsx or tsx -files are not getting built to js-files (which is what the browser understands) in Visual Studio’s build, this post might solve the issue for you. Description While converting a project using React.js to TypeScript (and, hence, to use .ts and .tsx files instead of .js and .jsx) I stumbled upon this error: Cannot use JSX unless the ‘–jsx’ flag is provided The project would not build a .tsx-file with ReactDOM.render(…) in it. This is a huge issue, of course, […]