Atom injection #893
Atom injection
#893
-
Beta Was this translation helpful? Give feedback.
Answered by
dai-shi
Dec 15, 2021
Replies: 1 comment 1 reply
-
Yes, passing an atom config in component props is a very good practice. We should improve the docs to promote it. You might want to use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kirrosh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, passing an atom config in component props is a very good practice. We should improve the docs to promote it.
You might want to use
useMemo
inuseAtom
:useAtom(useMemo(() => atom(...), [rangeAtom]))
otherwise, it could cause an infinite loop.