I have a React component with some generic properties and would like to type them using a generic type T. But I can't figure out where to put the T declaration.
Here's my component signature:
interface MyComponentProps<T> {
items: T
}
// ------------------------------------------v cannot find name T
const MyComponent: React.FC<MyComponentProps<T>> = ({
items
}) => {
// ...
}
Where can I put <T>
to satisfy the generic type declaration?
Thanks!