V
valtio
by @hairyfv
4.2(59)
专为React和原生JavaScript提供Valtio代理状态管理方案,简化前端状态逻辑。
安装方式
npx skills add hairyf/skills --skill valtiocompare_arrows
Before / After 效果对比
1 组使用前
在React或原生JavaScript项目中,复杂的状态管理常导致代码冗余和逻辑混乱。组件间数据同步困难,调试复杂,影响开发效率。
使用后
运用此技能,能够利用Valtio代理状态管理,简化React和原生JS应用。实现响应式数据流,减少样板代码,显著提升开发效率和代码可维护性。
SKILL.md
Valtio makes proxy-state simple for React and vanilla JavaScript. It provides a minimal, flexible, and unopinionated API that turns objects into self-aware proxies, enabling fine-grained subscription and reactivity. Valtio shines at render optimization in React and is compatible with Suspense and React 18+.
The skill is based on Valtio v2.3.0, generated at 2026-01-29.
Core References
| Topic | Description | Reference |
|---|---|---|
| Proxy | Create reactive state objects that track changes | core-proxy |
| useSnapshot | React hook for render-optimized state access | core-use-snapshot |
| Snapshot | Create immutable snapshots for comparison and Suspense | core-snapshot |
| Subscribe | Subscribe to state changes from anywhere | core-subscribe |
Utils
| Topic | Description | Reference |
|---|---|---|
| proxyMap | Observable Map-like proxy for Map data structures | utils-proxy-map |
| proxySet | Observable Set-like proxy for Set data structures | utils-proxy-set |
| subscribeKey | Subscribe to changes of a specific property | utils-subscribe-key |
| DevTools | Redux DevTools Extension integration | utils-devtools |
| Ref | Create unproxied references for special objects | utils-ref |
Guides
| Topic | Description | Reference |
|---|---|---|
| Component State | Isolate component state using useRef | guides-component-state |
| Computed Properties | Create computed properties with getters and setters | guides-computed-properties |
| Async | Work with promises and React Suspense | guides-async |
Best Practices
| Topic | Description | Reference |
|---|---|---|
| Actions | Organize actions for mutating state | best-practices-actions |
| Persistence | Persist state to localStorage or other storage | best-practices-persistence |
| State Composition | Split and compose states for organization | best-practices-state-composition |
用户评价 (0)
发表评价
效果
易用性
文档
兼容性
暂无评价
统计数据
安装量652
评分4.2 / 5.0
版本
更新日期2026年5月23日
对比案例1 组
用户评分
4.2(59)
5
36%
4
51%
3
14%
2
0%
1
0%
为此 Skill 评分
0.0
兼容平台
🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI
时间线
创建2026年3月16日
最后更新2026年5月23日