Skip to content

Commit 6738558

Browse files
committed
Log stack and timing of updateSyncExternalStore()
There's no API called this we just call it callback() but to give some hint.
1 parent ce35b3a commit 6738558

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,6 +1847,8 @@ function updateStoreInstance<T>(
18471847
// snapsho and getSnapshot values to bail out. We need to check one more time.
18481848
if (checkIfSnapshotChanged(inst)) {
18491849
// Force a re-render.
1850+
// We intentionally don't log update times and stacks here because this
1851+
// was not an external trigger but rather an internal one.
18501852
forceStoreRerender(fiber);
18511853
}
18521854
}
@@ -1861,6 +1863,7 @@ function subscribeToStore<T>(
18611863
// read from the store.
18621864
if (checkIfSnapshotChanged(inst)) {
18631865
// Force a re-render.
1866+
startUpdateTimerByLane(SyncLane, 'updateSyncExternalStore()');
18641867
forceStoreRerender(fiber);
18651868
}
18661869
};

0 commit comments

Comments
 (0)