-
I have a generic component that hold it's own atom, and in that component the atom is initialized using provider store. However inside that component i also need to modify global state atom outside the provider. Reproduction: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You may have a misconception about global atom. |
Beta Was this translation helpful? Give feedback.
You may have a misconception about global atom.
Atoms are just definitions and atom values are stored in a store.
So, you want to define a global store explicitly and specify it.
See how it works: https://codesandbox.io/s/crazy-buck-ryx209?file=/src/App.tsx