I have an example file called "test.ts" with this code:
const test = <T>(a: string) => { return a; } ;
It works! If I rename the file to "test.tsx" then Visual Studio Code marks the T parameter with red, and gives the following error:
[ts] Cannot find name 'T'.
[ts] JSX element 'T' has no corresponding close tag.
I must use .tsx extension because the actual code needs to return JSX elements. I also must use type parameters. But how can I do both?