Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- html 태그
- not 의사클래스
- Checked 의사 클래스
- go live
- RGB
- iframe 태그
- tag html
- 일반 형제 결합자
- html tag i
- 인접 형제 결합자
- padding 속성
- width속성
- height속성
- 아두이노
- Live Server
- reveal in file explorer
- id 선택자
- 전체 선택자
- iframe
- sup태그
- css
- i 태그
- focus 의사클래스
- 자식결합자
- br 태그
- RGBA
- sub태그
- html
- background-color 속성
- 임베디드
Archives
- Today
- Total
so woon!
[RECOIL] 로컬 스토리지 저장방법 본문
학습일 : 2023. 04. 25
https://www.npmjs.com/package/recoil-persist
recoil-persist
Package for recoil to persist and rehydrate store. Latest version: 4.2.0, last published: a year ago. Start using recoil-persist in your project by running `npm i recoil-persist`. There are 4 other projects in the npm registry using recoil-persist.
www.npmjs.com
사용을 위해 install
npm i recoil-persist
import
import { recoilPersist } from 'recoil-persist'
<atom.tsx>
atom 에
const { persistAtom } = recoilPersist();
effects_UNSTABLE: [persistAtom] 을
추가해주면 된다.
// recoil persist - 로컬스토리지 저장
const { persistAtom } = recoilPersist();
// toDoState
export const toDoState = atom<IToDo[]>({
key: "toDo",
default: [],
effects_UNSTABLE: [persistAtom],
});
'Recoil > 개념정리' 카테고리의 다른 글
[RECOIL] Selector - set 사용하기 (0) | 2023.04.25 |
---|---|
[RECOIL] 카테고리별로 todolist 작성하기 + enum으로 카테고리 관리하기 (0) | 2023.04.21 |
[RECOIL] Selector2 (0) | 2023.04.20 |
[RECOIL] Selector1 (0) | 2023.04.20 |
[RECOIL] Recoil 시작하기 + Recoil을 사용하여 다크모드 구현하기 (0) | 2023.04.15 |
Comments