VA

Valtio

valtio

🧙 Valtio makes proxy-state simple for React and Vanilla

State Management
react
state
manager
management
mobx
proxy
store
valtio
State Management
javascript
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install valtio

Code example

import { proxy, useSnapshot } from "valtio";

const state = proxy({ count: 0 });

export function Example() {
  const snap = useSnapshot(state);
  return (
    <button type="button" onClick={() => { state.count += 1; }}>
      Count: {snap.count}
    </button>
  );
}

Pros & cons

Pros

  • Actively maintained by Daishi Kato
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries