| name | valtio-define |
| description | Comprehensive skills for working with valtio-define |
| metadata | {"author":"Hairyf","version":"2026.04.16","source":"Internal Documentation"} |
Based on valtio-define v1.3.0 (updated since v1.2.1). A Valtio-based state management library with a Pinia-like API for React applications.
Overview
valtio-define provides a factory function for creating reactive stores with state, actions, and getters. Built on top of Valtio, it offers a familiar API similar to Pinia with full TypeScript support.
Core References
Advanced Features
Features
Quick Start
import { defineStore, useStore } from 'valtio-define'
const store = defineStore({
state: () => ({ count: 0 }),
actions: {
increment() { this.count++ },
},
getters: {
doubled() { return this.count * 2 },
},
})
function Counter() {
const state = useStore(store)
return (
<div>
<div>Count: {state.count}</div>
<div>Doubled: {state.doubled}</div>
<button onClick={store.increment}>Increment</button>
</div>
)
}