I am getting the following error when trying to use Typescript with a React Native Flat List:
Type '(item: navigationTypes) => JSX.Element' is not assignable to type 'ListRenderItem<unknown>'.
Here is my code:
type navigationTypes = { name: string href: string}const navigation = [ { name: 'Support', href: '/support' }, { name: 'Privacy Policy', href: '/privacy-policy' }, { name: 'Terms Of Use', href: '/terms-of-use' }, { name: 'Terms & Conditions', href: '/terms-&-conditions' },] const Item = ({ title = '', href = '' }) => (<View><Text><TextLink href={href}>{title}</TextLink></Text></View> )<View><FlatList horizontal data={navigation} renderItem={renderItem} keyExtractor={(item) => item.id} /></View>
I'm new to Typescript so I'm struggling to understand why there is an issue here.