함수: useAtom()
function useAtom<TValue>(
atom,
options?,
): [TValue, Atom<TValue>['set']];
정의 위치: octane-store/src/useAtom.ts:17
현재 아톰 값과 안정적인 세터를 함께 반환합니다.
동일한 아톰을 읽고 업데이트해야 하는 컴포넌트를 위한 쓰기 가능한 아톰 편의 훅입니다.
타입 매개변수
TValue
TValue
매개변수
atom
Atom<TValue>
options?
UseSelectorOptions<TValue>
반환값
[TValue, Atom<TValue>["set"]]
예시
const [count, setCount] = useAtom(countAtom)