Removing Default Panels From Gutenberg Document Setting Panel (sidebar)

import { store as editPostStore } from ‘@wordpress/edit-post’; Is not the same as const { editPostStore } = wp.editPost.store; In the first line store is editPostStore, but in your second line editPostStore is a property of store, but it doesn’t exist. The correct syntax is const editPostStore = wp.editPost.store; Or const { store: editPostStore } … Read more

Hook into viewport change?

There is no dedicated hook or event for this to listen for. Instead use the same data core uses to figure this out: select( ‘core/editor’ ).getDeviceType() e.g. in a react component: const { deviceType } = useSelect( ( select ) => select( ‘core/editor’ ).getDeviceType(), [] ); return <h1>{ deviceType }</h1>; Then you can declare deviceType … Read more