Gutenberg Inspector Controls

TextControl is from wp.components not wp.blocks. const { registerBlockType, RichText, AlignmentToolbar, BlockControls, InspectorControls, } = wp.blocks; const { TextControl } = wp.components; Changing that I was able to get your block to work fine instead of error in Gutenberg 2.2.0.

Changing text within the Block Editor

Changing the “Post reverted to draft.” text In WordPress version 5.0, WordPress introduced a new post type label which has the key item_reverted_to_draft and it’s defined as: item_reverted_to_draft – Label used when an item is switched to a draft. Default is ‘Post reverted to draft.’ / ‘Page reverted to draft.’ Hence, as with any other … Read more

Get the current block ID

The block id is saved in the clientId field. It’s regenerated at each save of the post and is only available in props in the edit function. In order to use this field as unique id in the save function, it needs to be saved as attribute in the edit section. It will be then … Read more

Change order/position of Gutenberg inspector control panel

<InspectorControls> <PanelBody title={ __( ‘Settings One’ ) }> </PanelBody> <PanelBody title={ __( ‘Settings Two’ ) }> </PanelBody> <PanelBody title={ __( ‘Settings Three’ ) > </PanelBody> </InspectorControls> If you insert multiple Panelbody like I did in above code. You will have multiple inspector controls with first one being ope by default. Change the panelbody accordingly to … Read more