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 ]