-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigation: Memoize link value passed to the LinkControl #51155
Conversation
I think we should eliminate the Why?
|
Size Change: +10 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this one up @Mamaduka!
I think we should eliminate the value to internal state sync altogether.
I agree, without your explanation it would have taken me a moment to work out why this PR fixed the underlying issue. For now, though, this looks like a good temporary fix to me!
Before | After |
---|---|
LGTM! ✨
I raised #51256 |
What?
Fixes #50976.
This is a regression after #50668.
PR updates the
LinkUI
component to pass memoized link value toLinkControl
and avoid losing internal state value when the component rerenders.Why?
The
LinkControl
uses thevalue
as a source of truth; if it changes, the component resets the internal state. See #49509.The
value
is an object; we should pass referentially stable objects to avoid unnecessary state synchronizations.Testing Instructions
Screenshots or screencast
Before
CleanShot.2023-05-30.at.14.43.52.mp4
After
CleanShot.2023-06-01.at.12.28.24.mp4