valtio
🧙 Valtio makes proxy-state simple for React and Vanilla
About this project
npm install valtio makes proxy-state simple Wrap your state object Valtio turns the object you pass it into a self-aware proxy. Mutate from anywhere You can make changes to it in the same way you would to a normal js-object. React via useSnapshot Create a local snapshot that catches changes. Rule of thumb: read from snapshots in render function, otherwise use the source. The component will only re-render when the parts of the state you access have changed, it is render-optimized. Note for TypeScript users: Return type of useSnapshot can be too strict. The snap variable returned by useSnapshot is a (deeply) read-only object. Its type has readonly attribute,…
Technologies
Project health
GitHub
Reviews
Built by
Maintain pmndrs/valtio? Claiming verifies admin access through your GitHub account and gives you control of this listing.