Discuss when to Use .ts vs .tsx
Learn about using .ts vs .tsx file extensions and when you should use each.
Similar to working in JS-only, you might be wondering, “when do I use .ts vs .tsx?” the answer is simple, does your file contain JSX, aka a component?
- use .tsx
- otherwise use .ts
The following resources provide more information for this lesson:
It's a similar rule. Does your file contain JSX? If it does, use tsx. If it's pure TypeScript and doesn't have JSX, use .ts.