2 ms·
> render -> onClick={e => this.onItemAdd(e)} -> onItemAdd -> addItem -> update -> UpdatePromise -> handleUpdateItems -> render loops you seem to have fallen p
by dominotw 11y ago
> render -> onClick={e => this.onItemAdd(e)} -> onItemAdd -> addItem -> update -> UpdatePromise -> handleUpdateItems -> render loops
you seem to have fallen prey to overengineered examples.
that example should be
>> render -> onClick={e => this.onItemAdd(e)}
thats it, data change should re render the tree.
- drdaeman 11y agoWell, maybe. But I also wanted it to sync up with the server too (onItemAdd actually updated component's own state with extra "save in progress" flag, handleUpdateItems would clear it later).
- dominotw 11y agowell then you are doing much more than A simple, almost ToDo-like You can do things like writing sever-syced component,mixin ect .