Skip to content

How to update the state when dependencies change #699

Answered by franky47
adel-bassiony asked this question in Q&A
Discussion options

You must be logged in to vote

That sounds like prop synchronization. Avoid it if you can as it's often a source of pain to maintain over time. If you don't have a choice, then useEffect is the way.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by franky47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #695 on October 23, 2024 07:55.