This repository has been archived by the owner on Jan 1, 2025. It is now read-only.
Replies: 1 comment 1 reply
-
According to the React semantics for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody,
What i'm trying to achieve:
Render another component if an atom value is reset, or set to a specific value.
The problem:
The effect is firing when the component is just rendered, i'm not making any chances to the atom, just listening to it, and it's already firing the update that renders the other component.
Question:
I had another cases of this happening, that just listening for the atom value, is already firing anything in the useEffect, is this the default behaviour or am I doing something wrong?
When a recoilState is listenned via a useEffect, it will allways fire by default when the component that has the effect is rendered?
Use case:
If i have a atom that I need to listen to changes to its value, and this value changed is the same as the atom default value, how can i listen to it only when the value is really changed?
queryBuilderState.ts
anyComponent.tsx
Hope it's enough information!
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions