Skip to content
Advertisement

How to translate a tsx file to a js file for React

I am working on a React Project and have a bunch of tsx files that I want to convert as use as javascript for my project. How should I do that?

Advertisement

Answer

I am working on a React Project and have a bunch of tsx files that I want to convert as use as javascript for my project. How should I do that

You can use the typescript compiler e.g.

npx -p typescript tsc somefile.tsx
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement