Skip to content

Commit

Permalink
Fix Slot/Fill emotion style provider
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jan 26, 2022
1 parent ffc8582 commit a3c980e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/components/src/slot-fill/bubbles-virtually/fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useRef, useState, useEffect, createPortal } from '@wordpress/element';
* Internal dependencies
*/
import useSlot from './use-slot';
import StyleProvider from '../../style-provider';

function useForceUpdate() {
const [ , setState ] = useState( {} );
Expand Down Expand Up @@ -48,5 +49,11 @@ export default function Fill( { name, children } ) {
children = children( slot.fillProps );
}

return createPortal( children, slot.ref.current );
const wrappedChildren = (
<StyleProvider document={ slot.ref.current.ownerDocument }>
{ children }
</StyleProvider>
);

return createPortal( wrappedChildren, slot.ref.current );
}

0 comments on commit a3c980e

Please sign in to comment.