validateDOMNesting: Allow hr as child of select (#27632)
fix #27572 --------- Co-authored-by: Sophie Alpert <git@sophiebits.com>
Sourabh singh committed
Nov 1, 2023 at 03:13 UTC
ca16c26356221a4b52185d7425d77675f0307250
1 file changed
+6
-1
packages/react-dom-bindings/src/client/validateDOMNesting.js
+6
-1
@@ -244,7 +244,12 @@ function isTagValidWithParent(tag: string, parentTag: ?string): boolean {
244
switch (parentTag) {
245
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
246
case 'select':
247
- return tag === 'option' || tag === 'optgroup' || tag === '#text';
247
+ return (
248
+ tag === 'hr' ||
249
+ tag === 'option' ||
250
+ tag === 'optgroup' ||
251
+ tag === '#text'
252
+ );
253
case 'optgroup':
254
return tag === 'option' || tag === '#text';
255
// Strictly speaking, seeing an <option> doesn't mean we're in a <select>