@@ -67,7 +67,6 @@ import sanitizeURL from '../shared/sanitizeURL';
67
67
68
68
import {
69
69
enableBigIntSupport ,
70
- enableCustomElementPropertySupport ,
71
70
disableIEWorkarounds ,
72
71
enableTrustedTypesIntegration ,
73
72
enableFilterEmptyStringAttributesDOM ,
@@ -870,9 +869,7 @@ function setProp(
870
869
}
871
870
case 'innerText' :
872
871
case 'textContent' :
873
- if ( enableCustomElementPropertySupport ) {
874
- break ;
875
- }
872
+ break ;
876
873
// Fall through
877
874
default : {
878
875
if (
@@ -983,25 +980,15 @@ function setPropOnCustomElement(
983
980
}
984
981
case 'innerText' : // Properties
985
982
case 'textContent' :
986
- if ( enableCustomElementPropertySupport ) {
987
- break ;
988
- }
983
+ break ;
989
984
// Fall through
990
985
default : {
991
986
if ( registrationNameDependencies . hasOwnProperty ( key ) ) {
992
987
if ( __DEV__ && value != null && typeof value !== 'function' ) {
993
988
warnForInvalidEventListener ( key , value ) ;
994
989
}
995
990
} else {
996
- if ( enableCustomElementPropertySupport ) {
997
- setValueForPropertyOnCustomComponent ( domElement , key , value ) ;
998
- } else {
999
- if ( typeof value === 'boolean' ) {
1000
- // Special case before the new flag is on
1001
- value = '' + ( value : any ) ;
1002
- }
1003
- setValueForAttribute ( domElement , key , value ) ;
1004
- }
991
+ setValueForPropertyOnCustomComponent ( domElement , key , value ) ;
1005
992
}
1006
993
}
1007
994
}
@@ -2293,35 +2280,30 @@ function diffHydratedCustomComponent(
2293
2280
case 'isContentEditable' :
2294
2281
case 'outerText' :
2295
2282
case 'outerHTML' :
2296
- if ( enableCustomElementPropertySupport ) {
2297
- extraAttributes . delete ( propKey . toLowerCase ( ) ) ;
2298
- if ( __DEV__ ) {
2299
- console . error (
2300
- 'Assignment to read-only property will result in a no-op: `%s`' ,
2301
- propKey ,
2302
- ) ;
2303
- }
2304
- continue ;
2305
- }
2306
- // Fall through
2307
- case 'className' :
2308
- if ( enableCustomElementPropertySupport ) {
2309
- // className is a special cased property on the server to render as an attribute.
2310
- extraAttributes . delete ( 'class' ) ;
2311
- const serverValue = getValueForAttributeOnCustomComponent (
2312
- domElement ,
2313
- 'class' ,
2314
- value ,
2315
- ) ;
2316
- warnForPropDifference (
2317
- 'className' ,
2318
- serverValue ,
2319
- value ,
2320
- serverDifferences ,
2283
+ extraAttributes . delete ( propKey . toLowerCase ( ) ) ;
2284
+ if ( __DEV__ ) {
2285
+ console . error (
2286
+ 'Assignment to read-only property will result in a no-op: `%s`' ,
2287
+ propKey ,
2321
2288
) ;
2322
- continue ;
2323
2289
}
2290
+ continue ;
2324
2291
// Fall through
2292
+ case 'className' :
2293
+ // className is a special cased property on the server to render as an attribute.
2294
+ extraAttributes . delete ( 'class' ) ;
2295
+ const serverValue = getValueForAttributeOnCustomComponent (
2296
+ domElement ,
2297
+ 'class' ,
2298
+ value ,
2299
+ ) ;
2300
+ warnForPropDifference (
2301
+ 'className' ,
2302
+ serverValue ,
2303
+ value ,
2304
+ serverDifferences ,
2305
+ ) ;
2306
+ continue ;
2325
2307
default : {
2326
2308
// This is a DEV-only path
2327
2309
const hostContextDev : HostContextDev = ( hostContext : any ) ;
@@ -2335,12 +2317,17 @@ function diffHydratedCustomComponent(
2335
2317
} else {
2336
2318
extraAttributes . delete ( propKey ) ;
2337
2319
}
2338
- const serverValue = getValueForAttributeOnCustomComponent (
2320
+ const valueOnCustomComponent = getValueForAttributeOnCustomComponent (
2339
2321
domElement ,
2340
2322
propKey ,
2341
2323
value ,
2342
2324
) ;
2343
- warnForPropDifference ( propKey , serverValue , value , serverDifferences ) ;
2325
+ warnForPropDifference (
2326
+ propKey ,
2327
+ valueOnCustomComponent ,
2328
+ value ,
2329
+ serverDifferences ,
2330
+ ) ;
2344
2331
}
2345
2332
}
2346
2333
}
0 commit comments