@@ -234,7 +234,7 @@ const DOM_PROPERTY_NAMES_ONE_WORD = [
234
234
// OpenGraph meta tag attributes
235
235
'property' ,
236
236
// React specific attributes
237
- 'ref' , 'key' , 'children' ,
237
+ 'ref' , 'key' , 'children' , 'precedence' ,
238
238
// Non-standard
239
239
'results' , 'security' ,
240
240
// Video specific
@@ -363,16 +363,20 @@ const REACT_ON_PROPS = [
363
363
] ;
364
364
365
365
function getDOMPropertyNames ( context ) {
366
- const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
366
+ let domPropertyNames = DOM_PROPERTY_NAMES_TWO_WORDS . concat ( DOM_PROPERTY_NAMES_ONE_WORD ) ;
367
367
// this was removed in React v16.1+, see https://github.com/facebook/react/pull/10823
368
368
if ( ! testReactVersion ( context , '>= 16.1.0' ) ) {
369
- return ALL_DOM_PROPERTY_NAMES . concat ( 'allowTransparency' ) ;
369
+ return domPropertyNames . concat ( 'allowTransparency' ) ;
370
370
}
371
371
// these were added in React v16.4.0, see https://reactjs.org/blog/2018/05/23/react-v-16-4.html and https://github.com/facebook/react/pull/12507
372
372
if ( testReactVersion ( context , '>= 16.4.0' ) ) {
373
- return ALL_DOM_PROPERTY_NAMES . concat ( REACT_ON_PROPS ) ;
373
+ domPropertyNames = domPropertyNames . concat ( REACT_ON_PROPS ) ;
374
+ // precedence was added in React v19, see https://react.dev/blog/2024/04/25/react-19#support-for-stylesheets
375
+ if ( testReactVersion ( context , '>= 19.0.0-0' ) ) {
376
+ domPropertyNames = domPropertyNames . concat ( 'precedence' ) ;
377
+ }
374
378
}
375
- return ALL_DOM_PROPERTY_NAMES ;
379
+ return domPropertyNames ;
376
380
}
377
381
378
382
// ------------------------------------------------------------------------------
0 commit comments