Rafael Hengles
Explore posts from serversevents not fired inside react modal
I can't provide a small reproduction, I tried but I couldn't.
I have a react project with reactstrap, and I'm using their standard Modal component.
Inside of it, I'm mounting a Solid app ( I already have other Solid apps working normally inside of React but outside of the modal ).
This app is not firing any click event handlers from Solid. There are no layers above in CSS.
I can't figure it out for the life of me.
I'm just hoping someone else has found this problem before and have any insights I can use to fix this.
In the moment, I'm trying to create my own modal component to see if the problem is in reactstrap somehow.
Thanks.
10 replies
setstore mutate more than one property in one call
Assume I have a store with a list of objects.
Can I write a single call to setStore() (without produce or reconcile) that modifies two or more properties of one or more objects in the array ?
In other words, if produce and reconcile already do this, how do they do it ? What do they return that enables them to mutate one object (not replace it, because it causes components with For to be recreated instead of updated) and change two or more properties in one go ?
Example:
The code above replaces the entire object. Again, it is a problem because it causes components with <For> to be recreated. Can I mutate two or more properties in one setState call without produce() or reconcile() ? What they do under the hood ?
12 replies
how to avoid child component re-creation with For
I have a store that is a list of tuples: each tuple is like ["type as string", { item, props }].
One of these items contains a value that I want to change like a controlled input, with a 'value' and a 'setValue' prop.
The problem is that when I call "setStore" to update the item value, the entire tuple is a new tuple with the changed value, it's not the same old tuple with the value mutated in place.
I use the <For> component to render this store list. AFAIU, when the For sees a new tuple, it removes the old <div> created by my component and recreates it all over again.
How can I have a store that is a list of tuples and change one value in this tuple without Solid re-creating my child components all the time ?
16 replies