-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Fix unnecessary re-rendering of various components when typing in web UI #15286
Conversation
42eeb93
to
c3beb60
Compare
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.
I am unsure about the ColumnsArea
changes. The other stuff looks good to me.
this.lastIndex = getIndex(this.context.router.history.location.pathname); | ||
this.setState({ shouldAnimate: true }); | ||
|
||
const newIndex = getIndex(this.context.router.history.location.pathname); | ||
|
||
if (this.lastIndex !== newIndex) { | ||
this.lastIndex = newIndex; | ||
this.setState({ shouldAnimate: true }); | ||
} |
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.
I am very unsure about this and haven't seen much benefit to this change.
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.
Actually, I am ok with this change, although the whole shouldAnimate
thing is buggy and I will try to improve it.
this.lastIndex = getIndex(this.context.router.history.location.pathname); | ||
this.setState({ shouldAnimate: true }); | ||
|
||
const newIndex = getIndex(this.context.router.history.location.pathname); | ||
|
||
if (this.lastIndex !== newIndex) { | ||
this.lastIndex = newIndex; | ||
this.setState({ shouldAnimate: true }); | ||
} |
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.
Actually, I am ok with this change, although the whole shouldAnimate
thing is buggy and I will try to improve it.
Due to a
componentDidUpdate
being caused byrouter
change inColumnsArea
, a state change was unnecessarily triggered which caused the whole UI to re-render from the top down. Also, the newpictureInPicture
attribute caused unnecessary re-renders onStatus
components.