Recoil에서 multiple root 사용하는 법

JJVoiture·2023년 3월 22일
0

Using Multiple <RecoilRoot>'s

Multiple <RecoilRoot>'s may co-exist and represent independent providers/stores of atom state; atoms will have distinct values within each root. This behavior remains the same when you nest one root inside anther one (inner root will mask outer roots), unless you specify override to be false (see "Props").

Note that caches, such as selector caches, may be shared across roots. Selector evaluations must be idempotent except for caching or logging, so this should generally not be a problem, however it is observable and may cause redundant queries to be cached across roots.

-> selector cache 같은 경우는 다른 루트끼리 서로 공유한다...
selector를 아예 빼자.

profile
안녕하세요.

0개의 댓글