How to do an Horizontal ListView, or FlatList in react-native

The answer is to add the horizontal property set to true.

Yeah now it's described in the doc: https://reactnative.dev/docs/flatlist#horizontal

So obviously a FlatList is a Child of a ScrollView so he got the Horizontal Bool.

  <FlatList
    horizontal={true}
    data={DATA}
    renderItem={renderItem}
    keyExtractor={(item) => item.id}
    extraData={selectedId}
  />

Ciao


Thanks for the last answer, ListView is now deprecated.

solution with FlatList:

<FlatList
    style={styles.videos_flatList}
    horizontal={true}
    data={data1}
    renderItem={({item}) => 
        <RowItem/>
    }

    ItemSeparatorComponent={() => {
        return (
            <View
                style={{
                height: "100%",
                width: 20,
                backgroundColor: "#CED0CE",

                }}
            />
        );
    }}

    keyExtractor={(item, index) => index.toString()}
/>