-
Using provider with atom that derive from atomsWithStorage trigger twice with initial value as first. Minimal repro:
jotai v2: jotai v1: (same code, work as expected). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Yes, it's a design choice. jotai/docs/guides/migrating-to-v2-api.mdx Line 213 in c4ef100 (That one line is not very helpful though...) See also: #1737 |
Beta Was this translation helpful? Give feedback.
-
I see, My case i have a component that has a props that will initialize the atom. basically it's #826 so i need provider to wrap the component. |
Beta Was this translation helpful? Give feedback.
I see,
But why it only happens when i wrap it with provider tag?
So what should i do if i want the same behavior like v1?
My case i have a component that has a props that will initialize the atom. basically it's #826 so i need provider to wrap the component.