Get loading state of wp data selector

Yes, it’s possible and you’d use wp.data.select( ‘core/data’ ).isResolving(). Example based on your code: const MyComponent = withSelect(select => { const { isResolving } = select( ‘core/data’ ); const query = { _fields: ‘id,name,slug’ }; return { terms: select(‘core’).getEntityRecords(“taxonomy”, “my_taxonomy”, query), isRequesting: isResolving( ‘core’, ‘getEntityRecords’, [ ‘taxonomy’, ‘my_taxonomy’, query ] ) }; })(props => { … Read more

WordPress Value of Undefined in Admin

Your value prop is the wrong format. From <LinkControl>‘s README: value Type: Object Required: No Current link value. A link value is composed of a union between the values of default link properties and any custom link settings. The resulting default properties of value include: url (string): Link URL. title (string, optional): Link title. opensInNewTab … Read more

How to make repeated component/block in Gutenberg

I think the best way to approach this is by creating 2 blocks with a parent -> child relationship. The child block would be a nested block only available within its parent block. Note the parent defined below. registerBlockType( ‘prefix/childblock’, { title: __( ‘Inner Child Block’ ), parent: [‘prefix/parentblock’], attributes:{ …//the rest of your block … Read more

Admin Notification after save_post, when ajax saving in gutenberg

Presenting Notices Gutenberg provides a mechanism for displaying notices in the form of the Notices Data package. In Gutenberg’s editors, the package’s selectors and action creators are exposed on the core/notices store, and can be accessed by any standard means therein, e.g.: useDispatch( ‘core/notices’ ) hook in functional components (including the edit() function of a … Read more

Managing two editable fields in gutenberg

Editable has been replaced with RichText in 2.2. Here’s a example of two RichText components being edit/saved together: const { __ } = wp.i18n; const { registerBlockType, RichText, } = wp.blocks; registerBlockType( ‘wtv/wtv’, { title: __( ‘wtv’, ‘wtv’ ), icon: ‘id’, category: ‘widgets’, keywords: [ __( ‘wtv’ ), __( ‘wtv’ ), __( ‘wtv’ ) ], … Read more