For is not Reactive ?
Hi, I've made this filter list using For:
The signal looks like this:
The console logs show that the value are changing, but the elements are not re-rendering. Am I missing something ?
10 Replies
You mutate the array, which doesn't trigger observers. You need to create a new array when setting the signal.
This works:
Thanks, I thought it was something like that. But this was an exemple from the docs so I trusted it.
oh really can you share the link?
I'll have to find that
Was 3 days ago ^^'
@Jasmin It still isn't updating the HTML 🥺
Damn it makes me feel super dumb
ohh you're editing an object. You need to recreate that too
The effect is triggering tho
yes because you are listening to
f.selected
and that isn't reactive if f
, the object doesn't changebut for your usecase, a store probably fits better:
https://www.solidjs.com/docs/latest/api#using-stores
SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
Thanks
It's really appreciated ❤️
I will try this out, have a great day
you're welcome! And thanks, you too! :)