Gutenberg – how to correctly perform ajax request on backend
If you wish to do it this way, you need to use the <ServerSideRender /> component in your edit method. Here’s a basic implementation, based on the PHP block registration code you provided. import { ServerSideRender } from ‘@wordpress/components’; registerBlockType( ‘some/block’, { title: ‘Some block’, attributes: { stuff : { } }, edit( { className, … Read more