@@ -74,6 +74,7 @@ import {
7474 enableCustomElementPropertySupport ,
7575 enableClientRenderFallbackOnTextMismatch ,
7676 enableHostSingletons ,
77+ disableIEWorkArounds ,
7778} from 'shared/ReactFeatureFlags' ;
7879import {
7980 mediaEventTypes ,
@@ -132,7 +133,7 @@ if (__DEV__) {
132133 // normalized. Since it only affects IE, we're skipping style warnings
133134 // in that browser completely in favor of doing all that work.
134135 // See https://github.com/facebook/react/issues/11807
135- canDiffStyleForHydrationWarning = canUseDOM && ! document . documentMode ;
136+ canDiffStyleForHydrationWarning = ( disableIEWorkArounds || ( canUseDOM && ! document . documentMode ) ) ;
136137
137138 warnForPropDifference = function (
138139 propName : string ,
@@ -308,7 +309,11 @@ function setInitialDOMProperties(
308309 } else if ( propKey === DANGEROUSLY_SET_INNER_HTML ) {
309310 const nextHtml = nextProp ? nextProp [ HTML ] : undefined ;
310311 if ( nextHtml != null ) {
311- setInnerHTML ( domElement , nextHtml ) ;
312+ if ( disableIEWorkArounds ) {
313+ domElement . innerHTML = nextHtml ;
314+ } else {
315+ setInnerHTML ( domElement , nextHtml ) ;
316+ }
312317 }
313318 } else if ( propKey === CHILDREN ) {
314319 if ( typeof nextProp === 'string' ) {
@@ -366,7 +371,11 @@ function updateDOMProperties(
366371 if ( propKey === STYLE ) {
367372 setValueForStyles ( domElement , propValue ) ;
368373 } else if ( propKey === DANGEROUSLY_SET_INNER_HTML ) {
369- setInnerHTML ( domElement , propValue ) ;
374+ if ( disableIEWorkArounds ) {
375+ domElement . innerHTML = propValue ;
376+ } else {
377+ setInnerHTML ( domElement , propValue ) ;
378+ }
370379 } else if ( propKey === CHILDREN ) {
371380 setTextContent ( domElement , propValue ) ;
372381 } else {
0 commit comments