I define the following interface
interface Axis {
renderTick?: <T>(data: T) => React.ReactNode
}
And now I want to make an object that uses that interface.
interface CustomData {
name: string
}
const renderTick: (data: CustomData) => ReactNode = ({name}: CustomData) => (<>{name}</>)
const axis: Axis = {
renderTick: renderTick
}
I had "Type 'T' is not assignable to type 'CustomData'" error