UNPKG

@swc-jotai/react-refresh

Version:

SWC plugin for supporting React Refresh with Jotai

14 lines (11 loc) 292 B
import { atom, useAtom } from "jotai"; const countAtom = atom(0); export default function AboutPage() { const [count, setCount] = useAtom(countAtom); return ( <div> <div>About us</div> {count} <button onClick={() => setCount((c) => c + 1)}>+1</button> </div> ); }