ATOM

카테고리 없음

Til (2023.02.14)

Recoil recoil은 전역으로 state를 조금 더 간편하고 이동할때 다양한 변형을 가능할 수 있게 해주는 라이브러리다. 리코일은 따로 atom.js를 만들어서 전역 state관리에 사용하게 된다. atom은 기본적으로 아래 처럼 atom 선언을 해준 후 키값, 기본값을 사용해 만들게 된다. import { atom } from "recoil"; export const LayoutButton = atom({ key: "Layout", default: "close", }); export const friendAllState = atom({ key: "friendAllState", default: [], }); 아톰에 위와 같이 만들어 준 후 사용법은 간단하게 아래 세가지를 이용해서 활용할 수 있다. ..

prdg
'ATOM' 태그의 글 목록