Testing: how to hydrate atomFamily? #2864
Unanswered
rovolution
asked this question in
Q&A
Replies: 1 comment 6 replies
-
useHydrateAtoms is for some specific cases such as hydration with SSR. It's not specifically for testing, and I would avoid using it for testing and look for other solutions. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
My application uses an
atomFamily
for create / caching atoms that map to a set of listings in my app (each listing has its own atom because it can be updated without affecting the others).When writing tests for this, how do I use
useHydrateAtoms()
to hydrate theatomFamily
? A bit confused since theuseHydrateAtoms()
hook examples seems to take a list of atoms + the mock value for the specific static atom (and atoms created viaatomFamily
can be dynamically created).Beta Was this translation helpful? Give feedback.
All reactions