From 58577f0d486a03669ddea2804a0c40a1e91e8c75 Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Tue, 9 Apr 2024 23:10:55 -0700 Subject: [PATCH] Mutate menu items state when flagging item customization --- .../components/src/tools-panel/tools-panel/hook.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/components/src/tools-panel/tools-panel/hook.ts b/packages/components/src/tools-panel/tools-panel/hook.ts index 60c0c9ae91127e..3d28159b07d174 100644 --- a/packages/components/src/tools-panel/tools-panel/hook.ts +++ b/packages/components/src/tools-panel/tools-panel/hook.ts @@ -216,14 +216,8 @@ export function useToolsPanel( group: ToolsPanelMenuItemKey = 'default' ) => { setMenuItems( ( items ) => { - const newState = { - ...items, - [ group ]: { - ...items[ group ], - [ label ]: value, - }, - }; - return newState; + items[ group ][ label ] = value; + return items; } ); }, [ setMenuItems ]