@@ -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 ,
@@ -116,7 +117,8 @@ if (__DEV__) {
116
117
// normalized. Since it only affects IE, we're skipping style warnings
117
118
// in that browser completely in favor of doing all that work.
118
119
// See https://github.com/facebook/react/issues/11807
119
- canDiffStyleForHydrationWarning = canUseDOM && ! document . documentMode ;
120
+ canDiffStyleForHydrationWarning =
121
+ disableIEWorkarounds || ( canUseDOM && ! document . documentMode ) ;
120
122
}
121
123
122
124
function validatePropertiesInDevelopment ( type : string , props : any ) {
@@ -308,7 +310,11 @@ function setInitialDOMProperties(
308
310
} else if ( propKey === DANGEROUSLY_SET_INNER_HTML ) {
309
311
const nextHtml = nextProp ? nextProp [ HTML ] : undefined ;
310
312
if ( nextHtml != null ) {
311
- setInnerHTML ( domElement , nextHtml ) ;
313
+ if ( disableIEWorkarounds ) {
314
+ domElement . innerHTML = nextHtml ;
315
+ } else {
316
+ setInnerHTML ( domElement , nextHtml ) ;
317
+ }
312
318
}
313
319
} else if ( propKey === CHILDREN ) {
314
320
if ( typeof nextProp === 'string' ) {
@@ -366,7 +372,11 @@ function updateDOMProperties(
366
372
if ( propKey === STYLE ) {
367
373
setValueForStyles ( domElement , propValue ) ;
368
374
} else if ( propKey === DANGEROUSLY_SET_INNER_HTML ) {
369
- setInnerHTML ( domElement , propValue ) ;
375
+ if ( disableIEWorkarounds ) {
376
+ domElement . innerHTML = propValue ;
377
+ } else {
378
+ setInnerHTML ( domElement , propValue ) ;
379
+ }
370
380
} else if ( propKey === CHILDREN ) {
371
381
setTextContent ( domElement , propValue ) ;
372
382
} else {
0 commit comments