I have a project VisualStudio 2017 built on ASP.NET Core 2.0 React Template . It defaults to working with TSX TypeScript files. I want to write in my project on the usual React JavaScript (JSX) but when I try to compile and run the project with such a file in the browser, it gives an error

... LoginPanel.jsx Unexpected token (16:15)

You may need this file type.

How can I enable support for standard JSX files?

    1 answer 1

    It helped this:

    In the webpack.config.js file webpack.config.js change this line by adding a pattern for jsx, as done in the example.

      rules: [ { test: /\.(tsx|jsx)?$/, include: /ClientApp/, use: 'awesome-typescript-loader?silent=true' }, 

    In the tsconfig.json file add

     "allowJs": true