Skip to content

Atom injection #893

Closed Answered by dai-shi
kirrosh asked this question in Show and tell
Dec 15, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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 in useAtom: useAtom(useMemo(() => atom(...), [rangeAtom]))
otherwise, it could cause an infinite loop.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kirrosh
Comment options

Answer selected by kirrosh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants