This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
Best practice for lists of atoms #1146
Unanswered
philipaarseth
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is the suggested way to make lists where a state change in one atom doesn't re-render the list itself or the other items?
To me it looks like making an atomFamily and then keeping a list of IDs in a separate atom (link below) is the suggested way, but making more state to keep in sync to make something work is firstly pretty awkward and also seems to go against the atomic state model of having your one source of truth and share it across the app.
#263 (comment)
If you try to implement this it may look something like this
https://stackoverflow.com/a/65216830/8512499
Where you create a selectorFamily and use the get and set functions to update both the atomFamily and the id array atom in sync.
Beta Was this translation helpful? Give feedback.
All reactions