For everyone who is looking for a solution:
The issue was that I wanted to use React. Component as I was sure it is required by WordPress. But Functional Component is also accepted, and in this case instead of componentDidMount you can use useEffect hook, which is executed each time sidebar is loaded and do the job perfectly.
Related Posts:
- Custom action button in Gutenberg editor (post_submitbox_misc_actions – equivalent)
- Adding pre-publish checks with Gutenberg
- Managing two editable fields in gutenberg
- How to make repeated component/block in Gutenberg
- Using Primary Color in Plugin Block
- How to create collections that are edited in admin?
- How Do I Make WordPress Run an Event Every Day?
- How to get data from WordPress $wpdb into React Gutenberg Blocks Frontend?
- lodash dependency in a Gutenberg plugin
- How to trap “Publish” button to check for meta box validation?
- Plugin Sidebar is not Saving Meta Attribute to Post/Page after “Update”
- What’s the Right Way to get and save remote data for a Gutenberg block?
- WordPress: After Gutenberg plugin migration to block.json the localization/ translations with PolyGlot in JavaScript does not work anymore
- Looking for callback function after Gutenberg is rendered?
- Error : “Updating failed: The response is not a valid JSON response” with custom shortcode
- Is there a better way to implement responsive images than what WordPress uses by default?
- Gutenberg registerFormatType with Multiple Classes
- Gutenberg: useDispatch is not a function – @wordpress/data included
- Gutenberg Block add element in the Editor inside InnerBlocks after div – editor-block-list
- Make a list with header and subtext in Gutenberg blocks
- How do you render_callback for register_block_type to a method in another class?
- How insert negative values in Gutenberg box-control
- Are block templates incompatible with serialize_blocks?
- How do I dynamically render an InnerBlock inside a dynamic block?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- WordPress Block Development – trouble importing from @wordpress/icons
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- How to access noticeOperations from withNotices
- How to prevent UNDO on guternberg block editor
- How to insert text at the current cursor position in Gutenberg?
- How to override gutenberg paragraph block edit property
- Do I have to worry about useState causing a re-render?
- How to get boolean value from register_meta properly?
- JSX in WordPress Plugin Development
- ResizableBox with RangeControl not working
- How can I get the selected string when using a toolbar button in Gutenberg?
- jQuery selectors for editor elements safe to use?
- There is a problem in the gutenberg block I developed. Problem is with withInstanceId
- Gutenberg table block with Bootstrap .table class
- How to add a gradient component to a custom block
- Invalid hook call on save, not edit when using swiper slider
- How to add template colors to custom block options in WordPress Gutenberg editor sidebar?
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- How to properly package a block plugin
- Setting global block attribute value
- Developing the save function in Gutenberg blocks
- Modify custom block plugin without losing content
- Custom Block Not Shown in Block Inserter
- How to override supports of innerBlocks?
- When setting styles to an extended block that was saved as a pattern, it doesn’t remove the style that was there
- extraprops override existing props
- WPGut – Updating failed and shortcode?
- Gutenberg – Call google map render function in save after DOM has been rendered
- Gutenberg block breaks when showing new data
- Is “document loaded” different on admin side than public side?
- How to re-render inspector controls?
- why is apiFetch throwing Unhandled Promise Rejection: TypeError: Object is not a function
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Where to save Gutenberg plugin data?
- Events Manager: Create custom Placeholder for use in Email notification
- Gutenberg component in a plugin admin
- How to integrate plugins into block editor
- Add custom html classes to gutenberg wrapper
- How to create save function for custom Gutenberg style block?
- Multi hook deploiement
- Identifying a Page Containing Shortcode at `init`
- Gutenberg and custom blocks messed up pagespeed score. What did I wrong?
- Gutenberg text field validation
- Undo operation not working in Rich text [Gutenberg]
- How can i add insertion point between inner blocks in my custom block like core blocks
- Gutenberg: – Call a function after Server Side Component is rendered
- Accept only PDF file for upload
- Render raw html in Gutenberg block
- get the queried_object of an url
- Build a dynamic block using the default attributes
- Add custom data-attribute to core Gutenberg block within an template
- Call API on post save/update and show the result in admin area
- How to get custom user meta by id in custom Gutenberg block
- How to replace content of a block in and re-render on change?
- extending a core block doesn’t work inside the editor
- Remove Gutenberg Buttons Block
- Insert text programmatically in WordPress Gutenberg Editor
- Translations not making it into Block UI but work in the rest of the plugin
- WordPress 6.6.1 – Trying to make a block but receive error, “! Cannot read property ‘then’ of undefined”
- How to use useSelect to retrieve the currently default fontFamily?
- Event when Modal is opened/visible
- Template locked block does not show appender
- Multiple php files in dynamic gutenberg block
- How to detect when the user clicks the publish/update button in Gutenberg Editor
- Gutenberg Static blocks: viewScript doesn’t import css for frontend?
- useBlockProps() nests wrapper with class name inside block wrapper in the editor
- Custom Gutenberg block with nested InnerBlocks renderAppender not displaying add button
- Is It Possible to Use the Block Editor’s Notification Feature to Send Another Notification After the Post Is Saved?
- Output HTML Tags In Gutenberg Block
- Can you nest columns/column in a gutenberg custom template?
- Can we write custom DOM manipulation inside edit.js file while developing custom Gutenberg block?
- User set default settings for a Block in Site Editor
- how to include an image in the build of a multi block plugin
- render_block_context filter and block context inheritance