RecoilRoot - initializeState prop usage #2023
-
Hi, Long story short, I'm trying to make snapshot tests my components but most of them depend on RecoilValues to render different content, so without proper initial value snapshots are pretty short and useless. I thought if I can wrap the testing component in a RecoilRoot with some initial value for an atom used in this particular component I would get the right snapshot. Checking docs I've found this prop "initializeState" and this seems to be what I need but I don't quite get it how to use it properly. If someone can give a few pointers on this prop or confirm that I can do what I want to do with this prop I would be really grateful! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, I've found the answer - #803 and then in the docs in a bit unexpected place (thought that where the prop was mentioned was the right place but it was in the Snapshot API). Anyway, now just have to test making meaningful snapshots. |
Beta Was this translation helpful? Give feedback.
Ok, I've found the answer - #803 and then in the docs in a bit unexpected place (thought that where the prop was mentioned was the right place but it was in the Snapshot API).
Anyway, now just have to test making meaningful snapshots.