jotai

โดย vercel

อะแดปเตอร์ Jotai สำหรับอินเทอร์เฟซ StateStore ของ json-render ใช้เมื่อรวม json-render กับ Jotai สำหรับการจัดการสถานะผ่าน @json-render/jotai

npx skills add https://github.com/vercel-labs/json-render --skill jotai

@json-render/jotai

Jotai adapter for json-render's StateStore interface. Wire a Jotai atom as the state backend for json-render.

Installation

npm install @json-render/jotai @json-render/core @json-render/react jotai

Usage

import { atom } from "jotai";
import { jotaiStateStore } from "@json-render/jotai";
import { StateProvider } from "@json-render/react";

// 1. Create an atom that holds the json-render state
const uiAtom = atom<Record<string, unknown>>({ count: 0 });

// 2. Create the json-render StateStore adapter
const store = jotaiStateStore({ atom: uiAtom });

// 3. Use it
<StateProvider store={store}>
  {/* json-render reads/writes go through Jotai */}
</StateProvider>

With a Shared Jotai Store

When your app already uses a Jotai <Provider> with a custom store, pass it so both json-render and your components share the same state:

import { atom, createStore } from "jotai";
import { Provider as JotaiProvider } from "jotai/react";
import { jotaiStateStore } from "@json-render/jotai";
import { StateProvider } from "@json-render/react";

const jStore = createStore();
const uiAtom = atom<Record<string, unknown>>({ count: 0 });

const store = jotaiStateStore({ atom: uiAtom, store: jStore });

<JotaiProvider store={jStore}>
  <StateProvider store={store}>
    {/* Both json-render and useAtom() see the same state */}
  </StateProvider>
</JotaiProvider>

API

jotaiStateStore(options)

Creates a StateStore backed by a Jotai atom.

OptionTypeRequiredDescription
atomWritableAtom<StateModel, [StateModel], void>YesA writable atom holding the state model
storeJotai StoreNoThe Jotai store instance. Defaults to a new store. Pass your own to share state with <Provider>.

Skills เพิ่มเติมจาก vercel

benchmark-sandbox
vercel
เรียกใช้สถานการณ์ประเมินผลของ vercel-plugin ใน Vercel Sandboxes แทนแผง WezTerm ในเครื่อง จัดเตรียม microVM ชั่วคราวที่ติดตั้ง Claude Code และปลั๊กอินไว้ล่วงหน้า…
official
emil-design-eng
vercel
ทักษะนี้เข้ารหัสปรัชญาของ Emil Kowalski เกี่ยวกับการตกแต่ง UI การออกแบบคอมโพเนนต์ การตัดสินใจเรื่องแอนิเมชัน และรายละเอียดที่มองไม่เห็นซึ่งทำให้ซอฟต์แวร์รู้สึกดี
official
vercel-react-best-practices
vercel
แนวทางปฏิบัติที่ดีที่สุดในการเพิ่มประสิทธิภาพ React และ Next.js จากทีมวิศวกรรมของ Vercel ควรใช้ทักษะนี้เมื่อเขียน ตรวจสอบ หรือปรับโครงสร้างโค้ด React/Next.js…
official
vercel-react-best-practices
vercel
แนวทางปฏิบัติที่ดีที่สุดในการเพิ่มประสิทธิภาพ React และ Next.js จากทีมวิศวกรรมของ Vercel ควรใช้ทักษะนี้เมื่อเขียน ตรวจสอบ หรือปรับโครงสร้าง React/Next.js…
official
write-guide
vercel
ผลิตคู่มือทางเทคนิคที่สอนกรณีการใช้งานในโลกจริงผ่านตัวอย่างแบบค่อยเป็นค่อยไป แนวคิดจะถูกนำเสนอเมื่อผู้อ่านต้องการเท่านั้น
official
release
vercel
ปลั๊กอิน Vercel สำหรับการปล่อย — รัน gates, เพิ่มเวอร์ชัน, สร้าง artifacts, คอมมิต และพุช ใช้เมื่อถูกขอให้ "release", "ship", "bump and push" หรือ "cut a release
official
deepsec
vercel
รัน DeepSec กับโปรเจกต์ Vercel ที่เช็คเอาท์จาก dev3000 ใช้สำหรับการตั้งค่า DeepSec แบบคลิกเดียว การบูตสแตรปบริบทโปรเจกต์ การประมวลผลรอบแรกแบบมีขอบเขต และ…
official
backport-pr
vercel
ย้อนกลับ pull request ของ Next.js ที่รวมแล้วจาก canary ไปยังสาขารุ่นก่อนหน้า เช่น next-16-2 ใช้เมื่อผู้ใช้ขอให้ย้อนกลับ, cherry-pick, หรือเปิด...
official