Encountering a problem when using the Create-React-App TypeScript template, the output is a JS file instead of a TSX file
<p>While trying to create a new React application using the Create-React-App template and TypeScript, I ran into a problem. I followed the instructions on the official documentation (https://create-react-app.dev/docs/adding-typescript/) and used the following command: </p>
<pre class="lang-bash prettyprint-override"><code>npx create-react-app my-app --template typescript
</code></pre>
<p>The following are the results of the command: </p>
<pre class="brush:php;toolbar:false;">Installing software package. This may take several minutes.
The version of react-scripts you are using is incompatible with the --template option.
Installing react, react-dom and react-scripts...
995 packages added in 32 seconds
There are 34 packages looking for funding
Run `npm fund` to learn more
success! created my-app-test under /home/ristirianto/belajar-react/my-app-test
Within this directory you can run several commands:
npm start
Start the development server.
npm run build
Package the application as static files for production.
npm test
Start the test runner.
npm run eject
Remove the tool and copy the build dependencies, configuration files, and scripts into the application directory. If you do this, you will not be able to return!
We recommend you start by typing:
cd my-app-test
npm start
Happy programming!
NOTE: This project is bootstrapped using an older version of unsupported tools.
Please update to Node >=14 and npm >=6 to get supported tools in new projects. </pre>
<p>My Node version: v18.17.1
My NPM version: 9.6.7</p>
<p>However, after the installation process, when I checked the files in the <code>my-app</code> folder, I noticed that the files had the extension <code>.js</code> ; instead of <code>.tsx</code> as TypeScript files should be. This seems to indicate that TypeScript is not configured correctly. </p>
<p>I'm not sure if I missed any steps or there's something wrong with the setup. Are there any steps I should take to ensure TypeScript is configured correctly when using the <code>--template typescript</code> option? </p>
<p>Any guidance or advice on how to troubleshoot and resolve this issue would be greatly appreciated. Thanks in advance for your help! </p>