• 💊 Valtio makes proxy-state simple

    Wrap your state object import { proxy, useProxy } from 'valtio' const state = proxy({ count: 0, text: 'hello' }) Mutate from anywhere setInterval(() => { ++state.count }, 1000) React via useProxy function Counter() { const snapshot = useProxy(state) // Rule of thumb: read from snapshots, mutate the source // The component renders when the snapshot-reads change return ( <div> {snapshot.

    star:720 fork:13 valtio
Github Trending Repositories

Explore Github Trending Repositories. See what the GitHub community is most excited about today.

Copyright 2010 - 2020