Repository navigation
Adjusting memoization on the DashWrapper to be utilized - #3248
Conversation
|
The initial test failed due to not being able to The current test for this hash is If the above is the desired outcome, I recommend having devs add a new prop to components that want to redraw on upstream adjustments and using that to switch to the older function which uses Heck, even adding it as a prop that Dash adds would work. |
|
There was an issue with the In this PR, we adjusted the A couple of other things that were minor
|
… to update `children`
…w children and generate hashes for them
adjusted the components as props test to work with redrawing
…ender or the target prop being adjusted vs having to crawl with the reducer the layouthash now has the props that triggered the change as well as the number of updates
|
Another thing on the last comment, I adjusted the way the memoizing works, it only holds onto the last rendered time. This helps with rerenders. |
…render, there is no hash or the component prop is in the changedProps. There was an issue if the component props had changed from the children, it would think that the parents props had changed and needed to re-render.
…nt can subscribe to based upon its prop definitions
|
I added i.e. when using an api component and |
# Conflicts: # CHANGELOG.md
…ibe, they need to place on the component: `namespace.component.dashRenderType = true`
T4rk1n
left a comment
There was a problem hiding this comment.
Nice job, just a few minor comments.
|
|
||
| /* eslint-disable @typescript-eslint/ban-ts-comment, @typescript-eslint/no-unused-vars */ | ||
| // @ts-ignore | ||
| const newlyRendered = useMemo(() => { |
There was a problem hiding this comment.
Can we put as newlyRendered: any instead of the ts-ignore?
There was a problem hiding this comment.
I'll check with the @ts-ignore the unused vars needs to be ignored.
There was a problem hiding this comment.
Still errors out in the build.
There was a problem hiding this comment.
Oh, I don't think useMemo is right in this case, should be useEffect.
There was a problem hiding this comment.
useEffect is not sync, while useMemo is sync. For the current to be used within the same sync it has to be useMemo.
There was a problem hiding this comment.
Went with useMemo without variable declaration
| componentPath: DashLayoutPath; | ||
| _dashprivate_error?: any; | ||
| _passedComponent?: any; | ||
| _newRender?: any; |
There was a problem hiding this comment.
Maybe add a comment describing those new props.
This is a PR to test the adjustment of memoization on the
DashWrapperyou can see info here: #3243