Skip to content

Commit 2205e5f

Browse files
ciampotyxlajsnajdr
authored
InspectorControlsSlot: remove unused framer motion context forwarding (#67522)
* InspectorControlsSlot: remove unused framer motion context forwarding * Remove computedFillProps, use fillProps directly --- Co-authored-by: ciampo <[email protected]> Co-authored-by: tyxla <[email protected]> Co-authored-by: jsnajdr <[email protected]>
1 parent f6c0334 commit 2205e5f

File tree

1 file changed

+3
-22
lines changed
  • packages/block-editor/src/components/inspector-controls

1 file changed

+3
-22
lines changed

packages/block-editor/src/components/inspector-controls/slot.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
22
* WordPress dependencies
33
*/
4-
import {
5-
__experimentalUseSlotFills as useSlotFills,
6-
__unstableMotionContext as MotionContext,
7-
} from '@wordpress/components';
8-
import { useContext, useMemo } from '@wordpress/element';
4+
import { __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';
95
import warning from '@wordpress/warning';
106
import deprecated from '@wordpress/deprecated';
117

@@ -37,19 +33,6 @@ export default function InspectorControlsSlot( {
3733
const slotFill = groups[ group ];
3834
const fills = useSlotFills( slotFill?.name );
3935

40-
const motionContextValue = useContext( MotionContext );
41-
42-
const computedFillProps = useMemo(
43-
() => ( {
44-
...fillProps,
45-
forwardedContext: [
46-
...( fillProps?.forwardedContext ?? [] ),
47-
[ MotionContext.Provider, { value: motionContextValue } ],
48-
],
49-
} ),
50-
[ motionContextValue, fillProps ]
51-
);
52-
5336
if ( ! slotFill ) {
5437
warning( `Unknown InspectorControls group "${ group }" provided.` );
5538
return null;
@@ -66,14 +49,12 @@ export default function InspectorControlsSlot( {
6649
<BlockSupportToolsPanel group={ group } label={ label }>
6750
<BlockSupportSlotContainer
6851
{ ...props }
69-
fillProps={ computedFillProps }
52+
fillProps={ fillProps }
7053
Slot={ Slot }
7154
/>
7255
</BlockSupportToolsPanel>
7356
);
7457
}
7558

76-
return (
77-
<Slot { ...props } fillProps={ computedFillProps } bubblesVirtually />
78-
);
59+
return <Slot { ...props } fillProps={ fillProps } bubblesVirtually />;
7960
}

0 commit comments

Comments
 (0)