valtio by hairyf/skills
npx skills add https://github.com/hairyf/skills --skill valtioValtio 为 React 和原生 JavaScript 简化了代理状态管理。它提供了一个极简、灵活且无预设的 API,可将对象转换为自感知的代理,从而实现细粒度的订阅和响应式能力。Valtio 在 React 渲染优化方面表现出色,并且兼容 Suspense 和 React 18+。
此技能基于 Valtio v2.3.0,生成于 2026-01-29。
| 主题 | 描述 | 参考链接 |
|---|---|---|
| Proxy | 创建可追踪变化的响应式状态对象 | core-proxy |
| useSnapshot | 用于渲染优化状态访问的 React Hook | core-use-snapshot |
| Snapshot | 创建用于比较和 Suspense 的不可变快照 | core-snapshot |
| Subscribe | 在任何地方订阅状态变化 | core-subscribe |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 主题 | 描述 | 参考链接 |
|---|---|---|
| proxyMap | 用于 Map 数据结构的类 Map 可观察代理 | utils-proxy-map |
| proxySet | 用于 Set 数据结构的类 Set 可观察代理 | utils-proxy-set |
| subscribeKey | 订阅特定属性的变化 | utils-subscribe-key |
| DevTools | Redux DevTools 扩展集成 | utils-devtools |
| Ref | 为特殊对象创建非代理引用 | utils-ref |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 组件状态 | 使用 useRef 隔离组件状态 | guides-component-state |
| 计算属性 | 使用 getter 和 setter 创建计算属性 | guides-computed-properties |
| 异步操作 | 处理 Promise 和 React Suspense | guides-async |
| 主题 | 描述 | 参考链接 |
|---|---|---|
| 操作 | 组织用于变更状态的操作 | best-practices-actions |
| 持久化 | 将状态持久化到 localStorage 或其他存储 | best-practices-persistence |
| 状态组合 | 拆分和组合状态以进行组织 | best-practices-state-composition |
每周安装量
519
代码仓库
GitHub 星标数
6
首次出现
2026年1月29日
安全审计
安装于
cursor515
claude-code476
trae460
gemini-cli65
github-copilot65
codex65
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.
| 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 |
| 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 |
| 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 |
| 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 |
Weekly Installs
519
Repository
GitHub Stars
6
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
cursor515
claude-code476
trae460
gemini-cli65
github-copilot65
codex65
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
106,200 周安装