Typescript TSX and generic parameters
问题 Typescript introduces support for the JSX syntax. So I have an expression that works quite well with traditional *.ts files but no with *.tsx ones: const f = <T1>(arg1: T1) => <T2>(arg2: T2) => { return { arg1, arg2 }; } I wonder is there a way to make it work inside a *.tsx file? 回答1: You could use function expressions instead: const f = function<T1>(arg1: T1) { return function<T2>(arg2: T2) { return { arg1, arg2 }; }; }; Or alternatively, I've discovered this works: const f = <T1, T2>(arg1: