[utils] skip deep clone React element#44400
Conversation
Netlify deploy previewhttps://deploy-preview-44400--material-ui.netlify.app/ @material-ui/core: parsed: -0.10% 😍, gzip: -0.05% 😍 Bundle size reportDetails of bundle changes (Toolpad) |
DiegoAndai
left a comment
There was a problem hiding this comment.
Skipping React elements in deepClone and deepMerge makes sense to me 👍🏼
Because this is a shared util, let's wait to see if @mui/x or @mui/toolpad have any objections. If there are none in a couple of days, we can go ahead and merge this.
Does that sound right?
|
We are not using either of those (unless they are used under the hood in some API we use) so for me it's good |
|
Thanks for the info @flaviendelangle @bharatkashyap |
DiegoAndai
left a comment
There was a problem hiding this comment.
@siriwatknp looks like we're good to go, let's merge 😊
|
@siriwatknp can you merge this fix into mui v5? There's the same issue. |
closes #44278
Root cause
Next.js 15 with Turbopack has a different signature for React element which cause the
@mui/utils/deepmergeto recursively deepclone React element. More details on #44278Fix
I think it does not make sense anyway for the deepmerge function to deepClone React elements.
So I added a check to deepmerge directly to avoid deepClone React elements.
Tested with https://github.com/nphmuller/mui-next-15_0_2_issue, this PR fixes the issue.