Bravi
How to handle reactivity in this example?
Hello. I have a
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?3 replies
How to prevent re-creation of a component inside <For>?
Hi everyone. To illustrate my issue, I created a very minimal version of the application that I have. To see the problem I am facing, just click on any of the links in the rendered page and then click on the button that appears. You will notice that the button will disappear (because the component gets re-created and the state is reset). What would be the best approach to prevent this from happening?
https://codesandbox.io/p/devbox/r5k78c
7 replies
How to use <Show> in ssr?
Hi everyone. I have this simple code:
Is it possible to somehow hide
Show
part from the downloaded js
files? What I mean is, if I land on this page and have a look at the network
tab, I can see that string inside one of the JS files.27 replies