JavaScript for WordPress Forums Gutenberg Development Is possible to wrap a RichText in a custom component?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #48267

    Hi, congratulations for this great course, I’m learning a lot.
    I’m trying to wrap several “gutenberg editor components” into a custom component so I can repeat them as a whole but it doesn’t seem to work. This is my pretty plain component (simplified):

        const EditorWrap = ( props ) => {
          const { attributes: {title} }= props;
          return (
                placeholder={__('Add your title here...')}
                value={ title }
                onChange={ title => setAttributes( {title} ) }

    And I add it to my edit return function as <EditorWrap {...props} />. The component appears in the admin, but it won’t get focus, though I can’t write in it so it’s useless.
    Any help on this? Thanks in advance, Paulo.

    Zac Gordon

    Yeah, this is a really good question and I believe they are working on extending this more. I am not sure yet if it is possible but I will look into it and try to include in the next update. In the meantime please ask in the core-editor Slack channel!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.