You can read the (very tiny) documentation on the getBlock function in the Block Editor Handbook. You should use the withDispatch
higher order component to feed your components (blocks) with actions.
withDispatch( ( dispatch, ownProps, registry ) => {
return {
updateEditable( isEditing ) {
const { clientId, setAttributes } = ownProps;
const { getBlockOrder, getBlock } = registry.select( 'core/block-editor' );
//get all innerBlockIds
const innerBlockIds = getBlockOrder( clientId );
innerBlockIds.forEach( ( innerBlockId ) => {
console.log( getBlock( innerBlockId ) );
} );
},
};
} )
To play around with the WordPress data module, that offers data about the editor or blocks to the client, you can also make use of the wp.data
-Module. In the backend view of Gutenberg editor, you can, for example, go to a browser console and type wp.data.select( 'core/block-editor' ).getBlock(<blocks-client-id>)
to test what the function does.
You can also have a look in the Gutenberg GitHub repository. Core Blocks also use these function, for example in columns.