Skip to content

Commit

Permalink
[Transition Tracing] Rename transitionCallbacks to unstable_transitio…
Browse files Browse the repository at this point in the history
…nCallbacks (#24920)

Renaming transitionCallbacks to unstable_transitionCallbacks as per convention
  • Loading branch information
lunaruan authored Jul 13, 2022
1 parent 4bc83e6 commit f629495
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/react-dom/src/client/ReactDOMRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export type RootType = {
export type CreateRootOptions = {
unstable_strictMode?: boolean,
unstable_concurrentUpdatesByDefault?: boolean,
unstable_transitionCallbacks?: TransitionTracingCallbacks,
identifierPrefix?: string,
onRecoverableError?: (error: mixed) => void,
transitionCallbacks?: TransitionTracingCallbacks,
...
};

Expand Down Expand Up @@ -216,8 +216,8 @@ export function createRoot(
if (options.onRecoverableError !== undefined) {
onRecoverableError = options.onRecoverableError;
}
if (options.transitionCallbacks !== undefined) {
transitionCallbacks = options.transitionCallbacks;
if (options.unstable_transitionCallbacks !== undefined) {
transitionCallbacks = options.unstable_transitionCallbacks;
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type TextInstance = {|
|};
type HostContext = Object;
type CreateRootOptions = {
transitionCallbacks?: TransitionTracingCallbacks,
unstable_transitionCallbacks?: TransitionTracingCallbacks,
...
};

Expand Down Expand Up @@ -828,8 +828,8 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
false,
'',
onRecoverableError,
options && options.transitionCallbacks
? options.transitionCallbacks
options && options.unstable_transitionCallbacks
? options.unstable_transitionCallbacks
: null,
);
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App navigate={false} />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -276,7 +278,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -333,7 +337,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -404,7 +410,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -497,7 +505,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -602,7 +612,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -717,7 +729,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -846,7 +860,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -1000,7 +1016,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -1085,7 +1103,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -1203,7 +1223,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
root.render(<App />);
ReactNoop.expire(1000);
Expand Down Expand Up @@ -1286,7 +1308,9 @@ describe('ReactInteractionTracing', () => {
);
}

const root = ReactNoop.createRoot({transitionCallbacks});
const root = ReactNoop.createRoot({
unstable_transitionCallbacks: transitionCallbacks,
});
await act(async () => {
startTransition(
() => root.render(<App markerName="one" markerKey="key" />),
Expand Down

0 comments on commit f629495

Please sign in to comment.