mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
validateDOMNesting: Allow hr as child of select (#27632)
fix #27572 --------- Co-authored-by: Sophie Alpert <git@sophiebits.com>
This commit is contained in:
co-authored by
Sophie Alpert
parent
0c6348758f
commit
ca16c26356
@@ -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 <option> doesn't mean we're in a <select>
|
||||
|
||||
Reference in New Issue
Block a user