-2

I have created an app in JS react. To continue my work i have come up with a file in TSX. What should I do ?

Can I import a TSX file and interact with it whithin a JSX file ? Should I transform my whole app to TSX for it to work ?

RouckyKM
  • 85
  • 1
  • 8

2 Answers2

2

Yes you can, you just need to include a tsconfig file, though it would be better to stick to one.

Kyano
  • 174
  • 1
  • 8
0

Like @Kyano said, yes you can. But it is not the right thing to do (a.k.a it is not a good practise).

You can however :

  • translate the tsx into jsx and then import the jsx.
  • Rewright the tsx file by your own in pure jsx
  • Move your all app into tsx (if you intend to).
alexzerah
  • 174
  • 1
  • 1
  • 11