Property 'customerCode' does not exist on type 'IntrinsicAttributes & Props & { children?: ReactNode; }'

Viewed 1321

Hey guys i'm getting this error from typescript: Property does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }' i export a default interface called iCustomer which i can use all over my project. But now i imported it on CustomerViewList as i was lazy to repeat myself when typing out the props.

after that i want to import the view and use it on my flat list and now kinda getting this error.

enter image description here

1 Answers

Typescript is telling you that CustomerViewList doesn't have a prop called "customerCode". It looks like you've defined two props, customer and onPress.

You should be able to write renderItem={({item}) => <CustomerViewList customer={item} onPress={onPress} /> }

Related