Closed bigmistqke closed 2 years ago
Thanks for the reproductions, React can be a bit to juggle this way and I wonder if I should be looking to update the approach again. In any case I will take a look when I get a chance.
Ok try version 0.27.1. The problem was in how nested updates were queued. I forced this on a microtask which was the easiest fix but not sure if there are other reprocussions.
lovely. seems to be working great in the minimal examples. thank you! I'll implement it in my react native app and will let u know if I face any issues there.
in the meanwhile I wrote a wrapper around react's createState to mimick Solid's API for useStore: https://codesandbox.io/s/wonderful-lamport-lb7c5
probably not so performant though, react's best-practices confuse me.
setting a signal or setting a store does trigger an update of the UI, but its previous value is being rendered instead of the updated value.
example with Signal: https://codesandbox.io/s/determined-satoshi-v2xk8?file=/src/App.js example with Store: https://codesandbox.io/s/frosty-silence-syubp?file=/src/App.js