I am new to react and I am working on a project. I come across both .ts
and .tsx
extensions. I don't understand where should I use .ts
and .tsx
. Any help on this is much appreciated. Thank you!
Use .ts
for pure TypeScript files.
Use .tsx
for files which contain JSX.
For example, a React component would be .tsx
, but a file containing helper functions would be .ts
.