-
Hi, Seems that if setting store atom, and using atom from component, the component will not react, is it planned ? const store = createStore() and then useAtom(fooAtom) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
I don't know full code, but useAtom has array form of return value, if you miss it. Also, you missed the {store: store} option.
and it should work |
Beta Was this translation helpful? Give feedback.
-
I don't find that syntax - useAtom(fooAtom, {store} ) i have to import like this:
so they are coming from different places when I do this, it does not work because of typings
useAtom does not accept atom from vanilla import... |
Beta Was this translation helpful? Give feedback.
-
You should provide a store with Provider. <Provider store={store}> then |
Beta Was this translation helpful? Give feedback.
-
Yes, I tried it in codesandbox and it does not give type errors. |
Beta Was this translation helpful? Give feedback.
You should provide a store with Provider.
then
useAtom(fooAtom)
works under the provider.