This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
[help] Get atom of atomFamily while id of it is choosen at runtime #1475
Unanswered
ChrisCross3
asked this question in
Q&A
Replies: 2 comments
-
While React hooks have to have a constant order during rendering, which atom you might use with it can be determined dynamically. So, you can select the atom to use at runtime from user input or other state. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your answer @drarmstr. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to output the value of an atom from its family in a function "renderAtomFamilyAtomValue".
The id of the atom is selected at runtime by the user. As I understand it, I can't do that, because the id has to be specified on initialization the hook and can't specify it dynamically in a function somewhere.
Is there a way to do it?
Beta Was this translation helpful? Give feedback.
All reactions