zh0nb
Array of components gets re-render every time that a new component is added
Hi, I'm struggling to allow users to add new inputs "on-the-fly" without forcing all elements to re-render (and therefore, losing their internal state). Not sure what I'm doing wrong, see the relevant part of my code below:
any idea on how I could keep the state for the elements that didn't change? For now I'm just adding new elements into the array, but the idea is that I also allow removing them
10 replies
onClick event does not get fired
Hi everyone,
I'm facing a weird issue where onClick events are not fired if I use them within a For loop. The button that's outside of the for loop (.working-button) is working fine, but the rest are not working at all.
This is the component's code (I'm using nanostores since I'm embedding this within an Astro website with
client:load
). You can see my code here:
I hope someone can help me to find out.
Thanks in advance!5 replies