Let's start with an example. The React Native component you'll use to render lists is FlatList, which works the same way on iOS and Android. List views accept a data property, which is an array of objects. These objects can have any properties you like, but they do require a key property. This is similar to the key property requirement for rendering <li> elements inside of a <ul> element. This helps the list to efficiently render when changes are made to the list data.
Let's implement a basic list now. Here's the code to render a basic 100-item list:
import React from "react";
import { Text, View, FlatList } from "react-native";
import styles from "./styles";
const data = new Array(100)
.fill(null)
.map((v, i) => ({ key: i.toString(), value: `Item ${i}` }));
export default function App() {
return (
<View style={styles.container}>
<FlatList
data={data}
renderItem={...