File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -555,15 +555,13 @@ function diffElementNodes(
555555 ) ;
556556
557557 // Remove children that are not part of any vnode.
558- if ( excessDomChildren != NULL ) {
558+ if (
559+ excessDomChildren != NULL &&
560+ newVNode . type != 'body' &&
561+ newVNode . type != 'head'
562+ ) {
559563 for ( i = excessDomChildren . length ; i -- ; ) {
560- const nodeName =
561- excessDomChildren [ i ] &&
562- excessDomChildren [ i ] . parentNode &&
563- excessDomChildren [ i ] . parentNode . localName ;
564-
565- if ( nodeName != 'head' && nodeName != 'body' )
566- removeNode ( excessDomChildren [ i ] ) ;
564+ removeNode ( excessDomChildren [ i ] ) ;
567565 }
568566 }
569567 }
Original file line number Diff line number Diff line change @@ -1969,6 +1969,7 @@ describe('render()', () => {
19691969
19701970 it ( 'should work with document' , ( ) => {
19711971 document . textContent = '' ;
1972+ document . body . textContent = '' ;
19721973 const App = ( ) => (
19731974 < Fragment >
19741975 < head >
You can’t perform that action at this time.
0 commit comments