@@ -322,6 +322,7 @@ export let didWarnAboutReassigningProps: boolean;
322
322
let didWarnAboutRevealOrder ;
323
323
let didWarnAboutTailOptions ;
324
324
let didWarnAboutDefaultPropsOnFunctionComponent ;
325
+ let didWarnAboutClassNameOnViewTransition ;
325
326
326
327
if ( __DEV__ ) {
327
328
didWarnAboutBadClass = ( { } : { [ string ] : boolean } ) ;
@@ -332,6 +333,7 @@ if (__DEV__) {
332
333
didWarnAboutRevealOrder = ( { } : { [ empty ] : boolean } ) ;
333
334
didWarnAboutTailOptions = ( { } : { [ string ] : boolean } ) ;
334
335
didWarnAboutDefaultPropsOnFunctionComponent = ( { } : { [ string ] : boolean } ) ;
336
+ didWarnAboutClassNameOnViewTransition = ( { } : { [ string ] : boolean } ) ;
335
337
}
336
338
337
339
export function reconcileChildren (
@@ -3295,6 +3297,25 @@ function updateViewTransition(
3295
3297
pushMaterializedTreeId ( workInProgress ) ;
3296
3298
}
3297
3299
}
3300
+ if ( __DEV__ ) {
3301
+ // $FlowFixMe[prop-missing]
3302
+ if ( pendingProps . className !== undefined ) {
3303
+ const example =
3304
+ typeof pendingProps . className === 'string'
3305
+ ? JSON . stringify ( pendingProps . className )
3306
+ : '{...}' ;
3307
+ if ( ! didWarnAboutClassNameOnViewTransition [ example ] ) {
3308
+ didWarnAboutClassNameOnViewTransition [ example ] = true ;
3309
+ console . error (
3310
+ '<ViewTransition> doesn\'t accept a "className" prop. It has been renamed to "default".\n' +
3311
+ '- <ViewTransition className=%s>\n' +
3312
+ '+ <ViewTransition default=%s>' ,
3313
+ example ,
3314
+ example ,
3315
+ ) ;
3316
+ }
3317
+ }
3318
+ }
3298
3319
if ( current !== null && current . memoizedProps . name !== pendingProps . name ) {
3299
3320
// If the name changes, we schedule a ref effect to create a new ref instance.
3300
3321
workInProgress . flags |= Ref | RefStatic ;
0 commit comments