Describe the bug
I'm trying to use @wordpress/block-editor as a standalone library and copied the example.
I am unable to get it running because, it appears like this call:
is failing because updateSlot is undefined as it's not part of the slot-fill-context.
Instead, it appears to have moved to the useSlot hook:
https://github.com/WordPress/gutenberg/blob/8ac282605512cb4ee0c90973b60e1d01596df018/packages/components/src/slot-fill/bubbles-virtually/use-slot.js#L18
In this PR:
https://github.com/WordPress/gutenberg/pull/19242
To reproduce
Steps to reproduce the behavior:
I used Create React App to get started.
@wordpress/block-editor example https://www.npmjs.com/package/@wordpress/block-editor#usage
Editor version (please complete the following information):
Pulled from package.json:
{
"@wordpress/block-editor": "^4.0.0",
"@wordpress/block-library": "^2.19.0",
"@wordpress/components": "^9.7.0",
"@wordpress/element": "^2.14.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
}
Desktop (please complete the following information):
@youknowriad or @diegohaz, could you advise what would be the preferred fix here?
Due to the convention that this module adopts, I think the preferred fix is to simply add updateSlot as a noop function to the default object that is returned by the context (when SlotFillProvider isn't present). I'll fix this asap. But I also wonder when using Slot/Fill without SlotFillProvider would make sense.
But I also wonder when using Slot/Fill without SlotFillProvider would make sense.
I think it鈥檚 must have to wrap both of them with SlotFillProvider. We could add some warnings to both of them to ensure it鈥檚 always properly configured.
Most helpful comment
I think it鈥檚 must have to wrap both of them with
SlotFillProvider. We could add some warnings to both of them to ensure it鈥檚 always properly configured.