Skip to content

Commit

Permalink
InspectorControlsSlot: remove unused framer motion context forwarding (
Browse files Browse the repository at this point in the history
…#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]>
  • Loading branch information
4 people authored Dec 5, 2024
1 parent f6c0334 commit 2205e5f
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions packages/block-editor/src/components/inspector-controls/slot.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
/**
* WordPress dependencies
*/
import {
__experimentalUseSlotFills as useSlotFills,
__unstableMotionContext as MotionContext,
} from '@wordpress/components';
import { useContext, useMemo } from '@wordpress/element';
import { __experimentalUseSlotFills as useSlotFills } from '@wordpress/components';
import warning from '@wordpress/warning';
import deprecated from '@wordpress/deprecated';

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

const motionContextValue = useContext( MotionContext );

const computedFillProps = useMemo(
() => ( {
...fillProps,
forwardedContext: [
...( fillProps?.forwardedContext ?? [] ),
[ MotionContext.Provider, { value: motionContextValue } ],
],
} ),
[ motionContextValue, fillProps ]
);

if ( ! slotFill ) {
warning( `Unknown InspectorControls group "${ group }" provided.` );
return null;
Expand All @@ -66,14 +49,12 @@ export default function InspectorControlsSlot( {
<BlockSupportToolsPanel group={ group } label={ label }>
<BlockSupportSlotContainer
{ ...props }
fillProps={ computedFillProps }
fillProps={ fillProps }
Slot={ Slot }
/>
</BlockSupportToolsPanel>
);
}

return (
<Slot { ...props } fillProps={ computedFillProps } bubblesVirtually />
);
return <Slot { ...props } fillProps={ fillProps } bubblesVirtually />;
}

0 comments on commit 2205e5f

Please sign in to comment.