@@ -74,6 +74,7 @@ import {
74
74
enableCustomElementPropertySupport ,
75
75
enableClientRenderFallbackOnTextMismatch ,
76
76
enableHostSingletons ,
77
+ disableIEWorkArounds ,
77
78
} from 'shared/ReactFeatureFlags' ;
78
79
import {
79
80
mediaEventTypes ,
@@ -132,7 +133,7 @@ if (__DEV__) {
132
133
// normalized. Since it only affects IE, we're skipping style warnings
133
134
// in that browser completely in favor of doing all that work.
134
135
// See https://github.com/facebook/react/issues/11807
135
- canDiffStyleForHydrationWarning = canUseDOM && ! document . documentMode ;
136
+ canDiffStyleForHydrationWarning = ( disableIEWorkArounds || ( canUseDOM && ! document . documentMode ) ) ;
136
137
137
138
warnForPropDifference = function (
138
139
propName : string ,
@@ -308,7 +309,11 @@ function setInitialDOMProperties(
308
309
} else if ( propKey === DANGEROUSLY_SET_INNER_HTML ) {
309
310
const nextHtml = nextProp ? nextProp [ HTML ] : undefined ;
310
311
if ( nextHtml != null ) {
311
- setInnerHTML ( domElement , nextHtml ) ;
312
+ if ( disableIEWorkArounds ) {
313
+ domElement . innerHTML = nextHtml ;
314
+ } else {
315
+ setInnerHTML ( domElement , nextHtml ) ;
316
+ }
312
317
}
313
318
} else if ( propKey === CHILDREN ) {
314
319
if ( typeof nextProp === 'string' ) {
@@ -366,7 +371,11 @@ function updateDOMProperties(
366
371
if ( propKey === STYLE ) {
367
372
setValueForStyles ( domElement , propValue ) ;
368
373
} 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
+ }
370
379
} else if ( propKey === CHILDREN ) {
371
380
setTextContent ( domElement , propValue ) ;
372
381
} else {
0 commit comments