-
selector code
fetching code in container
Screen.Recording.2022-09-14.at.0.16.51.mov
am I using selector in wrong way? |
Beta Was this translation helpful? Give feedback.
Answered by
drarmstr
Sep 16, 2022
Replies: 1 comment 1 reply
-
It looks like there is an infinite loop here because when the If |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
LOGANLEEE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like there is an infinite loop here because when the
fetchHospitalAccount
selector is updated then it will set thehospitalAtom
to a new object instance. But,fetchHospitalAccount
subscribes tohospitalAtom
so it will then re-evaluate thus causing your infinite loop.If
fetchHospitalAccount
is intended to query based on the current idx fromhospitalAtom
then it should not try to go back and update it via auseEffect()
.