Skip to content

Infinite loop of the 'componentDidUpdate' method (caused by an infinite state update). #250

@Gianarci

Description

@Gianarci

Hi,

I've tried to render a list with a multiple items (of fixed size) per row, but it always prints 'ReactList failed to reach a stable state' in the console and slowdown the rendering. I've tried with both flex-box and inline-block, but no success. For e.g. the following fails:

.item {
    display: inline-block;
    width: 300px;
    height: 420px;
}

const itemsRenderer = (items: JSX.Element[], ref: string) => <div ref={ref as any}>{items}</div>;

const itemRenderer = (i: number) => <div key={`control_${i}`} className='item'>test</div>;

<ReactList itemRenderer={itemRenderer} itemsRenderer={itemsRenderer} length={500} type='uniform' />

Can anyone show me a correct and stable way to render a list with multiple items per row? Thanks in advance.

P.S.: If I change 'inline-block' to 'block' the message disappears.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions