Hook into select( ‘core/editor’ ).getDeviceType() ?
-
Hey guys, four months ago i created a block component which use useEffect() to listen to __experimentalSetPreviewDeviceType()
useEffect(() => {
let viewport;
if (select('core/edit-site')) {
viewport = select('core/edit-site').__experimentalGetPreviewDeviceType();
}
if (select('core/edit-post')) {
viewport = select('core/edit-post').__experimentalGetPreviewDeviceType();
}
}, []);This code not work anymore for some reason. Is there any changes to device type?
I want that my component will listen to __experimentalGetPreviewDeviceType(), how i can do that?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.