Skip to content

Why valtio? #58

Answered by segunadebayo
with-heart asked this question in Q&A
Apr 28, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @with-heart,

Valtio provided the base-level primitives we need for the machine state management.

  • Fine-grained reactivity for subscriptions (using Proxy).
  • Ability to simply mutate the context rather than wrapping things in assign(...).
  • Support for computed state properties like proxyWithComputed, derive, etc.
  • When used with react, you get a useSnapshot hook that automatically optimizes re-renders based on property access.

These are some of the benefits we get from valtio. I think we're pretty flexible with the base library as long as it's able to support these features as well.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@with-heart
Comment options

Answer selected by segunadebayo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants