primetwig / react-nestable

Drag & drop hierarchical list made as a react component
ISC License
215 stars 96 forks source link

re-render? #18

Closed bknill closed 5 years ago

bknill commented 6 years ago

The component doesn't seem to update when the data changes. Any way to force an update?

primetwig commented 6 years ago

it uses shallow compare. you should change your data in immutable way or update it like:

<Nestable items={[...items]} />

While you can use it as a hotfix till you start sticking to immutability, it can lead to some performance issues if you have more that 100 items.