Skip to content

Commit 03eb7d3

Browse files
committed
Rename ViewTransition prop className to default
1 parent 4845e16 commit 03eb7d3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

packages/react-reconciler/src/ReactFiberApplyGesture.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function trackDeletedPairViewTransitions(deletion: Fiber): void {
151151
// and can stop searching (size reaches zero).
152152
pairs.delete(name);
153153
const className: ?string = getViewTransitionClassName(
154-
props.className,
154+
props.default,
155155
props.share,
156156
);
157157
if (className !== 'none') {
@@ -196,7 +196,7 @@ function trackEnterViewTransitions(deletion: Fiber): void {
196196
? appearingViewTransitions.get(name)
197197
: undefined;
198198
const className: ?string = getViewTransitionClassName(
199-
props.className,
199+
props.default,
200200
pair !== undefined ? props.share : props.enter,
201201
);
202202
if (className !== 'none') {
@@ -259,7 +259,7 @@ function applyAppearingPairViewTransition(child: Fiber): void {
259259
// Note that this class name that doesn't actually really matter because the
260260
// "new" side will be the one that wins in practice.
261261
const className: ?string = getViewTransitionClassName(
262-
props.className,
262+
props.default,
263263
props.share,
264264
);
265265
if (className !== 'none') {
@@ -282,7 +282,7 @@ function applyExitViewTransition(placement: Fiber): void {
282282
const props: ViewTransitionProps = placement.memoizedProps;
283283
const name = getViewTransitionName(props, state);
284284
const className: ?string = getViewTransitionClassName(
285-
props.className,
285+
props.default,
286286
// Note that just because we don't have a pair yet doesn't mean we won't find one
287287
// later. However, that doesn't matter because if we do the class name that wins
288288
// is the one applied by the "new" side anyway.
@@ -307,7 +307,7 @@ function applyNestedViewTransition(child: Fiber): void {
307307
const props: ViewTransitionProps = child.memoizedProps;
308308
const name = getViewTransitionName(props, state);
309309
const className: ?string = getViewTransitionClassName(
310-
props.className,
310+
props.default,
311311
props.update,
312312
);
313313
if (className !== 'none') {
@@ -336,7 +336,7 @@ function applyUpdateViewTransition(current: Fiber, finishedWork: Fiber): void {
336336
// want the props from "current" since that's the class that would've won if
337337
// it was the normal direction. To preserve the same effect in either direction.
338338
const className: ?string = getViewTransitionClassName(
339-
newProps.className,
339+
newProps.default,
340340
newProps.update,
341341
);
342342
if (className === 'none') {

packages/react-reconciler/src/ReactFiberCommitViewTransitions.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function commitAppearingPairViewTransitions(placement: Fiber): void {
228228
}
229229
const name = props.name;
230230
const className: ?string = getViewTransitionClassName(
231-
props.className,
231+
props.default,
232232
props.share,
233233
);
234234
if (className !== 'none') {
@@ -267,7 +267,7 @@ export function commitEnterViewTransitions(
267267
const props: ViewTransitionProps = placement.memoizedProps;
268268
const name = getViewTransitionName(props, state);
269269
const className: ?string = getViewTransitionClassName(
270-
props.className,
270+
props.default,
271271
state.paired ? props.share : props.enter,
272272
);
273273
if (className !== 'none') {
@@ -337,7 +337,7 @@ function commitDeletedPairViewTransitions(deletion: Fiber): void {
337337
const pair = pairs.get(name);
338338
if (pair !== undefined) {
339339
const className: ?string = getViewTransitionClassName(
340-
props.className,
340+
props.default,
341341
props.share,
342342
);
343343
if (className !== 'none') {
@@ -389,7 +389,7 @@ export function commitExitViewTransitions(deletion: Fiber): void {
389389
? appearingViewTransitions.get(name)
390390
: undefined;
391391
const className: ?string = getViewTransitionClassName(
392-
props.className,
392+
props.default,
393393
pair !== undefined ? props.share : props.exit,
394394
);
395395
if (className !== 'none') {
@@ -470,7 +470,7 @@ export function commitBeforeUpdateViewTransition(
470470
// a layout only change, then the "foo" class will be applied even though
471471
// it was not actually an update. Which is a bug.
472472
const className: ?string = getViewTransitionClassName(
473-
newProps.className,
473+
newProps.default,
474474
newProps.update,
475475
);
476476
if (className === 'none') {
@@ -495,7 +495,7 @@ export function commitNestedViewTransitions(changedParent: Fiber): void {
495495
const props: ViewTransitionProps = child.memoizedProps;
496496
const name = getViewTransitionName(props, child.stateNode);
497497
const className: ?string = getViewTransitionClassName(
498-
props.className,
498+
props.default,
499499
props.update,
500500
);
501501
if (className !== 'none') {
@@ -735,7 +735,7 @@ export function measureUpdateViewTransition(
735735
const oldName = getViewTransitionName(oldFiber.memoizedProps, state);
736736
// Whether it ends up having been updated or relayout we apply the update class name.
737737
const className: ?string = getViewTransitionClassName(
738-
props.className,
738+
props.default,
739739
props.update,
740740
);
741741
if (className === 'none') {
@@ -787,7 +787,7 @@ export function measureNestedViewTransitions(
787787
const state: ViewTransitionState = child.stateNode;
788788
const name = getViewTransitionName(props, state);
789789
const className: ?string = getViewTransitionClassName(
790-
props.className,
790+
props.default,
791791
props.update,
792792
);
793793
let previousMeasurements: null | Array<InstanceMeasurement>;

packages/react-reconciler/src/ReactFiberViewTransitionComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type ViewTransitionClass = 'none' | string | ViewTransitionClassPerType;
2929
export type ViewTransitionProps = {
3030
name?: string,
3131
children?: ReactNodeList,
32-
className?: ViewTransitionClass,
32+
default?: ViewTransitionClass,
3333
enter?: ViewTransitionClass,
3434
exit?: ViewTransitionClass,
3535
share?: ViewTransitionClass,

0 commit comments

Comments
 (0)