-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
https://stackblitz.com/edit/github-3vpjew?file=src%2FApp.tsx
- About page has url search params, and i use atomWithLocation to get it
- Other pages dont use atomWithLocation
- enter Home page first is required , then go to About page
jotai-location/src/atomWithLocation.ts
Lines 86 to 97 in 8e7194d
baseAtom.onMount = (set) => { const callback = () => set(getL()); const unsub = sub(callback); callback(); return unsub; }; const derivedAtom = atom( (get) => get(baseAtom), (get, set, arg: SetStateAction<T>, atomOptions: AtomOptions<T> = {}) => { set(baseAtom, arg); appL(get(baseAtom), { ...options, ...atomOptions }); },
maybe we can return getL()
when baseAtom not mount. not just get(baseAtom
Metadata
Metadata
Assignees
Labels
No labels