-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Improve performance of context components re-rendering #3066
base: dev
Are you sure you want to change the base?
Conversation
The test_redraw shows failure with 5 redraw instead of 2. There is two cases of additional redraw that need to be fixed in this pr:
|
{Array.isArray(layout) ? ( | ||
layout.map((c, i) => | ||
isSimpleComponent(c) ? ( | ||
c | ||
) : ( | ||
<TreeContainer | ||
<DashWrapper |
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.
OK, new component - is this going to break any legacy code?
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.
No, it shouldn't as this is an internal component.
@@ -1,4 +1,4 @@ | |||
type Config = { | |||
export type DashConfig = { |
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.
👍 for the name change - why does it have to be exported?
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.
It is used in the new DashWrapper.tsx.
@@ -26,6 +26,18 @@ export const apiRequests = [ | |||
'loginRequest' | |||
]; | |||
|
|||
function callbackNum(state = 0, action) { | |||
// With the refactor of TreeContainer to DashWrapper |
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.
thank you for the explanation
@@ -0,0 +1,425 @@ | |||
import React, {useMemo, useCallback} from 'react'; |
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.
OK, I'm going to trust you on this - I don't know enough of Dash and TypeScript to review something this large. @emilykl can you please have a look? (who else might be a good reviewer?)
I think for the additional redraw might be coming from the new path, before it was |
Fix #3057
Gif showing only the clicked button is re-rendered: