From 0330fa832cf3dc75c91599320e35fc4d61baf7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Mon, 3 Aug 2020 13:57:07 +0300 Subject: [PATCH] RichText: back compat for multiline root tag (#24324) --- packages/rich-text/src/component/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rich-text/src/component/index.js b/packages/rich-text/src/component/index.js index 4b2529a3b47805..76d8fc64d13268 100644 --- a/packages/rich-text/src/component/index.js +++ b/packages/rich-text/src/component/index.js @@ -178,6 +178,12 @@ function RichText( { } ) { const [ activeFormats = [], setActiveFormats ] = useState(); + // For backward compatibility, fall back to tagName if it's a string. + // tagName can now be a component for light blocks. + if ( ! multilineRootTag && typeof TagName === 'string' ) { + multilineRootTag = TagName; + } + function getDoc() { return ref.current.ownerDocument; }