From 25bf50b467c85a89e6dd222cdf72be9e86feb799 Mon Sep 17 00:00:00 2001 From: Sourabh singh <96938361+SouSingh@users.noreply.github.com> Date: Wed, 1 Nov 2023 03:13:16 +0530 Subject: [PATCH] validateDOMNesting: Allow hr as child of select (#27632) fix #27572 --------- Co-authored-by: Sophie Alpert --- .../react-dom-bindings/src/client/validateDOMNesting.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-dom-bindings/src/client/validateDOMNesting.js b/packages/react-dom-bindings/src/client/validateDOMNesting.js index ac7da96939a4f..85e6b69bfa4ce 100644 --- a/packages/react-dom-bindings/src/client/validateDOMNesting.js +++ b/packages/react-dom-bindings/src/client/validateDOMNesting.js @@ -244,7 +244,12 @@ function isTagValidWithParent(tag: string, parentTag: ?string): boolean { switch (parentTag) { // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect case 'select': - return tag === 'option' || tag === 'optgroup' || tag === '#text'; + return ( + tag === 'hr' || + tag === 'option' || + tag === 'optgroup' || + tag === '#text' + ); case 'optgroup': return tag === 'option' || tag === '#text'; // Strictly speaking, seeing an