Gutenberg RichText

I’m using the RichText API for a custom block:

<RichText
tagName=”a”
className=”button”
placeholder={ __( ‘Button text…’ ) }
value={ buttonText }
onChange={ ( value ) => setAttributes( { buttonText: value } ) }
/>

I am using a as the tag name because I want the element to be a link but I’m not sure how to add a URL. Is it possible to add a href attribute? Adding href=”some URL” to RichText does not work. I looked through the documentation and Googled it but couln’t find any guidance.

Read more here:: Gutenberg RichText

Leave a Reply

Your email address will not be published. Required fields are marked *