@@ -322,6 +322,7 @@ export let didWarnAboutReassigningProps: boolean;
322322let didWarnAboutRevealOrder ;
323323let didWarnAboutTailOptions ;
324324let didWarnAboutDefaultPropsOnFunctionComponent ;
325+ let didWarnAboutClassNameOnViewTransition ;
325326
326327if ( __DEV__ ) {
327328 didWarnAboutBadClass = ( { } : { [ string ] : boolean } ) ;
@@ -332,6 +333,7 @@ if (__DEV__) {
332333 didWarnAboutRevealOrder = ( { } : { [ empty ] : boolean } ) ;
333334 didWarnAboutTailOptions = ( { } : { [ string ] : boolean } ) ;
334335 didWarnAboutDefaultPropsOnFunctionComponent = ( { } : { [ string ] : boolean } ) ;
336+ didWarnAboutClassNameOnViewTransition = ( { } : { [ string ] : boolean } ) ;
335337}
336338
337339export function reconcileChildren (
@@ -3295,6 +3297,25 @@ function updateViewTransition(
32953297 pushMaterializedTreeId ( workInProgress ) ;
32963298 }
32973299 }
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+ }
32983319 if ( current !== null && current . memoizedProps . name !== pendingProps . name ) {
32993320 // If the name changes, we schedule a ref effect to create a new ref instance.
33003321 workInProgress . flags |= Ref | RefStatic ;
0 commit comments