Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Will the DOM elements prebuild be a big performance concern? #263

@bfang711

Description

@bfang711

I know the number of total DOM elements upfront, so don't want to use infinite loading mode. However in the preparation for the DOM LONG list, one has to for-loop to generate all the DOM elements, although only several of them being actually rendered while the rest are clustered in a big blank DOM, according to the author of react-infinite. e.g. the sample code given in the manual.

  buildElements: function(start, end) {
        var elements = [];
        for (var i = start; i < end; i++) {
            elements.push(<ListItem key={i} num={i}/>)
        }
        return elements;
    },

I just wonder if the "for-loop" gonna be a performance concern if I have 1M elements in my list. Again, not related to rendering, but just this for-loop to reserve the DOM slots in the long list.

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions