File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-dom/src/client Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
2222 DOCUMENT_NODE ,
2323 ELEMENT_NODE ,
2424 COMMENT_NODE ,
25+ DOCUMENT_FRAGMENT_NODE ,
2526} from '../shared/HTMLNodeType' ;
2627
2728import {
@@ -222,7 +223,7 @@ function legacyRenderSubtreeIntoContainer(
222223}
223224
224225export function findDOMNode (
225- componentOrElement : Element | ?React$Component < any , any > ,
226+ componentOrElement : Element | DocumentFragment | ?React$Component < any , any > ,
226227) : null | Element | Text {
227228 if ( __DEV__ ) {
228229 let owner = ( ReactCurrentOwner . current : any ) ;
@@ -244,7 +245,8 @@ export function findDOMNode(
244245 if ( componentOrElement == null ) {
245246 return null ;
246247 }
247- if ( ( componentOrElement : any ) . nodeType === ELEMENT_NODE ) {
248+ const nodeType = ( componentOrElement : any ) . nodeType ;
249+ if ( nodeType === ELEMENT_NODE || nodeType === DOCUMENT_FRAGMENT_NODE ) {
248250 return ( componentOrElement : any ) ;
249251 }
250252 if ( __DEV__ ) {
You can’t perform that action at this time.
0 commit comments