diff --git a/packages/components/src/slot-fill/bubbles-virtually/slot.js b/packages/components/src/slot-fill/bubbles-virtually/slot.js index d1347a92272426..0483a5057e1f22 100644 --- a/packages/components/src/slot-fill/bubbles-virtually/slot.js +++ b/packages/components/src/slot-fill/bubbles-virtually/slot.js @@ -1,12 +1,7 @@ /** * WordPress dependencies */ -import { - useEffect, - useRef, - useLayoutEffect, - useContext, -} from '@wordpress/element'; +import { useRef, useLayoutEffect, useContext } from '@wordpress/element'; import isShallowEqual from '@wordpress/is-shallow-equal'; /** @@ -25,7 +20,7 @@ export default function Slot( { const ref = useRef(); const slot = useSlot( name ); - useEffect( () => { + useLayoutEffect( () => { registry.registerSlot( name, ref, fillProps ); return () => { registry.unregisterSlot( name, ref ); diff --git a/packages/components/src/slot-fill/stories/index.js b/packages/components/src/slot-fill/stories/index.js index 48d07ef62b69c8..035defa5eb4f6e 100644 --- a/packages/components/src/slot-fill/stories/index.js +++ b/packages/components/src/slot-fill/stories/index.js @@ -13,7 +13,13 @@ import { createContext, useContext } from '@wordpress/element'; */ import { Slot, Fill, Provider } from '../'; -export default { title: 'Components/SlotFill', component: Slot }; +export default { + title: 'Components/SlotFill', + component: Slot, + parameters: { + storyshots: { disable: true }, + }, +}; export const _default = () => { return ( diff --git a/storybook/test/__snapshots__/index.js.snap b/storybook/test/__snapshots__/index.js.snap index 04c2ce67b11331..d17f24d407078a 100644 --- a/storybook/test/__snapshots__/index.js.snap +++ b/storybook/test/__snapshots__/index.js.snap @@ -7887,56 +7887,6 @@ exports[`Storyshots Components/ScrollLock Default 1`] = ` `; -exports[`Storyshots Components/SlotFill Default 1`] = ` -Array [ -
- Name: - -
, -- Age: - -
, -] -`; - -exports[`Storyshots Components/SlotFill With Context 1`] = ` -Array [ -- Name: - -
, -- Age: - -
, -] -`; - -exports[`Storyshots Components/SlotFill With Fill Props 1`] = ` -Array [ -- Name: - - -
, -- Age: - - -
, -] -`; - exports[`Storyshots Components/Snackbar Default 1`] = `