Rendering with FlatList
Learn that renderItem receives an object whose item property holds the data.
Codejavascript
import React from 'react';
import { FlatList, Text } from 'react-native';
export default function Names() {
const data = [{ id: '1', name: 'Ann' }];
return (
<FlatList
data={data}
renderItem={(item) => <Text>{item.name}</Text>}
/>
);
}What is the bug in this code?