I am using the React Native FlatList like this:
export const UserList: React.FunctionComponent<UserListProps> = ({ data, onSendRequest,}) => { return (<View><FlatList data={data?.users?.nodes} horizontal={false} scrollEnabled renderItem={({ item }) => (<User user={item} onSendRequest={onSendRequest} /> )} keyExtractor={(item) => item?.id?.toString()} ListEmptyComponent={NoUsersContainer} /></View> );};
Currently, it renders all items. Is there any way I can introduce some sort of checks inside the Flatlist? For instance, if
data.users.nodes.id == 1
then don't render while all the rest should be rendered. Generally we could do something like this with a ternary operator or if-else statements but I couldn't think of a clean, correct way for FlatLists.