To get it to understand it’s a type parameter and not a JSX element, you can add a comma after the type parameter:
const f = <T1,>(arg1: T1) => <T2,>(arg2: T2) => {
return { arg1, arg2 };
};
Or you could use function expressions instead:
const f = function<T1>(arg1: T1) {
return function<T2>(arg2: T2) {
return { arg1, arg2 };
};
};
Or alternatively, in this scenario, this works:
const f = <T1, T2>(arg1: T1) => (arg2: T2) => {
return { arg1, arg2 };
};