I have a component HorizontalList
that render this:
<HorizontalList data={categories} renderItem={renderCategories} titleList={'Categories'}/>
this is my component file that receives the following props
//HorizontalList.tsxinterface Props { titleList: string; data: object[]; renderItem: <--- //IDK what type should be here;}const HorizontalList: React.FC<Props> = ({titleList, data, renderItem}) => { return (<View style={styles.root}><Text style={styles.titleText}>{titleList}</Text><FlatList horizontal data={data} renderItem={renderItem} /></View> );};
but I dont know what type should be renderItem
prop, I tried with () => JSX.Element
, but in I get the error:
Type '({ item }: { item: ICategorieItem; }) => JSX.Element' is not assignable to type '() => Element'.