How to handle reactivity in this example?
Hello. I have a
I have a separate components that is supposed to render
This component grabs project store from context and then renders items inside a custom
This is how I update my store:
When I do this, there is a visual glitch where the new order is being set, but it is reverted straight away. On the subsequent reorder, the correct order is set. But the 3rd one is also a glitch and etc.
To solve this, I have to do the following:
Am I doing something wrong or this is the way to go?
Project type I have a context provider that provides the store of Project. So in my components I grab it like so - const { project, setProject } = useProject().I have a separate components that is supposed to render
project.nodes and it uses SortableJS.This component grabs project store from context and then renders items inside a custom
Sortable component. It all works fine, until I try to update the state on reorder.This is how I update my store:
When I do this, there is a visual glitch where the new order is being set, but it is reverted straight away. On the subsequent reorder, the correct order is set. But the 3rd one is also a glitch and etc.
To solve this, I have to do the following:
Am I doing something wrong or this is the way to go?
