Provide more documentation on how to convert RichText with multiline property to use InnerBlocks instead #47395
Replies: 6 comments 12 replies
-
Hi @kory-northrop, Personally, I think that there are so many different cases of block migration and deprecation that it is sometimes difficult to document them. If it's a case like yours. a migration of the list block may be helpful. Also, the use of a react hook called useInnerBlocksProps would give you more flexibility and control over the markup of the inner block. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply @t-hamano. I looked over those resources and feel like I made some progress, but I'm still not successfully deprecating this block. This is the message in the developer console, which makes me think that the new deprecation version is not converting the saved multiline RichText content properly.
This is the deprecation code that I added:
|
Beta Was this translation helpful? Give feedback.
-
@kory-northrop |
Beta Was this translation helpful? Give feedback.
-
From this message, it appears that the |
Beta Was this translation helpful? Give feedback.
-
I've created blocks that use multiple RichText components. But you can't use multiple InnerBlocks components. So what's the solution there? |
Beta Was this translation helpful? Give feedback.
-
Our team has spent about 10 hours modifying a custom block to migrate from the RichText multiline property to InnerBlocks and hasn't found an effective solution. Our goal was to transition from using RichText for adding multiple paragraphs to allowing InnerBlocks to include only Paragraph blocks inside our block. We're running into these issues:
We've tried a number of options to fix this issue with no luck:
We're hoping we're missing something simple here, but we're struggling with how complex it has become to implement functionality we used to accomplish with the single If anyone has ideas on how to solve this problem more simply, please let us know. We're very open to suggestions and input. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I developed a custom static block years ago that uses the component with the multiline property. I've started seeing the following notice in the web developer console when editing posts in Gutenberg:
wp.blockEditor.RichText multiline prop is deprecated since version 6.1 and will be removed in version 6.3. Please use nested blocks (InnerBlocks) instead. See: https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/
I've poured over that documentation as well as the Deprecation page, but cannot quite figure out how to accomplish the task of converting my block to use and still honor the original functionality that I built and be backwards compatible. I imagine that it involves using migrate() within the deprecated array, but I am struggling to crack the code and don't feel like there's ample documentation to help developers with this kind of conversion.
Here is a simplified example of what the block looked like originally:
This is what the block looks like now as I'm trying to replace
<RichText>
multiline with<InnerBlocks />
:Beta Was this translation helpful? Give feedback.
All reactions