I know this question has been asked before but none of the answers helped me. I am getting this error in a file which contains this:
<View style={styles.listHolder}> {data && (<MyList data={userData} onSendRequest={onSendRequest}></MyList> )}</View>
Here data
is returned by a grapqhl query (Apollo). The error is somewhere in the MyList component which looks like this:
type UserProps = { data: UsersLazyQueryHookResult; //originatorId: number; onSendRequest: (id: number) => void;};export const MyList: React.FunctionComponent<UserProps> = ({ data, //originatorId, onSendRequest,}) => { return (<View> {data && (<FlatList data={data.users.nodes} horizontal={false} scrollEnabled renderItem={({ item }) => (<User user={item} onSendRequest={onSendRequest} /> )} keyExtractor={(item) => item.id.toString()} ListEmptyComponent={NoFriendsContainer} /> )}</View> );};
In this component, the error falls somewhere on the first line of the return which says <View>
What am I missing out? Note that the brackets before MyList come automatically when I use Prettier for formatting.