You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to update a state without triggering redraw ?
I have a component A with children A1 and A2. A1 is quite complex and A2 is very simple.
I want to update A2 based on callbacks from A1.
For that I use use_state_eq in A to store the property of A2 I want to update (which I do using a callback passed to A1).
I think the call to use_state_eq triggers a re-render of A, when the only thing that changes is A2.
I think I could avoid re-render using a non-functional A that could handle messages without re-rendering but can it be done in a functional component ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is it possible to update a state without triggering redraw ?
I have a component A with children A1 and A2. A1 is quite complex and A2 is very simple.
I want to update A2 based on callbacks from A1.
For that I use
use_state_eq
in A to store the property of A2 I want to update (which I do using a callback passed to A1).I think the call to
use_state_eq
triggers a re-render of A, when the only thing that changes is A2.I think I could avoid re-render using a non-functional A that could handle messages without re-rendering but can it be done in a functional component ?
Beta Was this translation helpful? Give feedback.
All reactions