Skip to content

Component assumes that the data prop is mutated, not replaced #4

@richiec

Description

@richiec

If you're using this with Redux, the data prop may be taken from the redux store, in which case it will be a new array each time (not the original array mutated). This means that as elements are added and removed to the tree, the component doesn't update. To get around this, when binding a container component to the store, be sure to use a key prop to signal the change. For example:

<TreeView data={props.data} key={props.data.length === 0 ? -1 : props.data[0].id}/>

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