I want to create an if loop inside my Flatlist return so that each time a new Flatlist is called, my 'pass' will go back to 0Here is my code:
<FlatList data={letter.description} numColumns={2} keyExtractor={(_, index) => index.toString()} renderItem={({ item }) => { return ( //if (pass>letter.description?.length) { //pass=0; //}<View><Text style={{ fontSize: 18, fontWeight: "600", marginTop: 25, width: "50%", }}> {letter.data[pass]} {"\n"}</Text><Text style={{ marginTop: 50, width: "50%" }}> {letter.description[pass]} {pass++} {"\n"}</Text></View> ); }} />
How do I do it?