@@ -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,8 @@ 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 =
137
+ disableIEWorkarounds || ( canUseDOM && ! document . documentMode ) ;
136
138
137
139
warnForPropDifference = function (
138
140
propName : string ,
@@ -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