Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1036,10 +1036,6 @@ export function scheduleUpdateOnFiber(
if (enableTransitionTracing) {
const transition = ReactSharedInternals.T;
if (transition !== null && transition.name != null) {
if (transition.startTime === -1) {
transition.startTime = now();
}

addTransitionToLanesMap(root, transition, lane);
}
}
Expand Down
10 changes: 8 additions & 2 deletions packages/react/src/ReactStartTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ function releaseAsyncTransition() {
}
}


const now =
typeof performance === 'object' && typeof performance.now === 'function'
? () => performance.now()
: () => Date.now();

export function startTransition(
scope: () => void,
options?: StartTransitionOptions,
Expand All @@ -65,7 +71,7 @@ export function startTransition(
if (enableTransitionTracing) {
currentTransition.name =
options !== undefined && options.name !== undefined ? options.name : null;
currentTransition.startTime = -1; // TODO: This should read the timestamp.
currentTransition.startTime = now();
}
if (__DEV__) {
currentTransition._updatedFibers = new Set();
Expand Down Expand Up @@ -146,7 +152,7 @@ export function startGestureTransition(
if (enableTransitionTracing) {
currentTransition.name =
options !== undefined && options.name !== undefined ? options.name : null;
currentTransition.startTime = -1; // TODO: This should read the timestamp.
currentTransition.startTime = now();
}
if (__DEV__) {
currentTransition._updatedFibers = new Set();
Expand Down