Using tanstack router, tanstack query, and jotai together, there are cases where data cannot be obtained. #3014
-
repo url: I fetch the data in advance in beforeLoad and set the atom after fetching. But in the atomWithQuery of another component on the same page, the get method cannot retrieve data, but getDefaultStore can. |
Beta Was this translation helpful? Give feedback.
Answered by
rothsandro
Mar 6, 2025
Replies: 1 comment 1 reply
-
Your components are wrapped in a You can either remove the provider if you want to use the default store, |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shlroland
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your components are wrapped in a
<Provider>
which creates a new store, so yourTestC
component uses this store instead of the default store.You can either remove the provider if you want to use the default store,
or create a custom store, use it when setting the atom value and provide it to the
Provider
component.