Linked Questions

Popular Questions

How to make multiple rows using horizontal flatlist in react native

Asked by At

I want to create horizontal flatlist with multiple rows in my app, but the output is just one row, how to make this to be multiple rows?

I've tried to make this.state.products to array and splice it with 3 size each array, but it didn't change.

constructor() {
    this.state = {
        products = products

render() {
    var arrays = [], size = 3;
    while(this.state.products.length > 0)
        arrays.push(this.state.products.splice(0, size)
             keyExtractor={(item, index) => index.toString()}
             renderItem={({item, index}) => (
                 {item.length > 1 ?
                 : null}
                 {item.length > 2 ?
                 : null}

I want in first column has 3 rows with different data of products in each row. And if it has 3 rows it will be move to next column with 3 rows again.

The ouput that I want

Related Questions