Check out example codes for "why can't define generic function in tsx file". It will help you in understanding the concepts better.

Code Example 1

const f = <T1, _>(arg1: T1) => {
   return { arg1 };
};

// or just adding a comma
const g = <T1,>(arg1: T1) => {
   return { arg1 };
};

Learn ReactJs, React Native from akashmittal.com