typescript write generic function in tsx code example
Example: why can't define generic function in tsx file
const f = <T1, _>(arg1: T1) => {
return { arg1 };
};
// or just adding a comma
const g = <T1,>(arg1: T1) => {
return { arg1 };
};
const f = <T1, _>(arg1: T1) => {
return { arg1 };
};
// or just adding a comma
const g = <T1,>(arg1: T1) => {
return { arg1 };
};