You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sounds very difficult.
If we simply display (add to the list) with useSetAtom, it will be infinite and leak memory. It might be fine in practice, but we pay attention for memory leaks and won't take such approach.
In v2 API, your workaround seems most reasonable for now. If you are using default store (no providers), getDefaultStore should help, and you don't need useEffect (and leaks memory).
I am using useAtomsDevtools().
If I use useSetAtom() for atom in the react component and do not useAtom() or useAtomValue(), the atom is not displayed in the Redux Devtools.
As a workaround, I was able to display the atom in Redux Devtools by using the store obtained with useStore() and setting
store.sub(atom, () => {})
.Although useAtomDevtools() will allow you to display with the Redux Devtools, we prefer not to use it because it causes unnecessary re-rendering.
It would be nice if useAtomsDevtools() would also display the atom when useSetAtomValue() is used.
The text was updated successfully, but these errors were encountered: