How to put and components inside in Gutenberg block

When an element doesn’t have children it can be self-closing: <Something something=”123″ /> Otherwise it needs to behave like normal html tag with an opening part: <Something> and a closing one: </Something> edit: function( props ) { return( <Form method=”get” className=”search-form” > <PlainText title=”search box” placeholder=”Search” className=”search-field” type=”text” name=”s” readonly=”true” /> <PlainText type=”hidden” name=”type” value=”media” … Read more

gutenberg attributes

From the docs: If a selector is specified, the source behavior will be run against the corresponding element(s) contained within the block. You are telling your block to look at the same Element for the value of both your attributes.(The first p tag) Change the second selector to something like p:last-of-type or give your p … Read more

Deprecated function not working in Gutenberg

Looking at the documentation from https://developer.wordpress.org/block-editor/developers/block-api/block-deprecation/ I think you may need the following migrate( { text } ) { return { content: text }; }, So in your case: migrate( { avatarSize } ) { avatarSize: { type: ‘number’, default: 70 } content: text }; }, Hopefully points you in the correct direction

How to change Block Controls Icon in Gutenberg?

There is a controls prop you can use which is an object. It goes inside. Controls has an icon key which takes a string which corresponds to a Dashicon slug. <BLockControls controls={[ icon=”wordpress” title=__(“Test”, “gutenberg-examples”), onClick: () => { doSomething }, isActive: false ]} />