How to move these divs?

Hi there I'm new solid and somewhat new to programming as well. I have a question https://playground.solidjs.com/anonymous/8bf7649a-04f9-478d-be34-13d0a8e80e7a Basically the add button adds an element to the array signal which then gets looped over to make Ball components. The createEffect of the Ball positions the divs according to the props received. Now I'd like the move button to loop throught the array and change properties thus moving all the Ball divs. In react I could just add a dependency array to rerun useEffect everytime the props change. I'm not sure how to do this in solid
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
3 Replies
Alex Lohr
Alex Lohr2y ago
Ideally, you would use a store with the ball positions from which you update CSS variables in a style-object, thus only updating those values that actually changed.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
BlackCaesar
BlackCaesar2y ago
Oh wow thanks a lot. That really put me on the right track. I will study both your solutions and learn from them.
Want results from more Discord servers?
Add your server