Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
lxsmnsyc committed Feb 17, 2025
1 parent 3a2291f commit 97b9de6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/scan/src/new-outlines/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export const isValidFiber = (fiber: Fiber) => {
export const initReactScanInstrumentation = (setupToolbar: () => void) => {
if (hasStopped()) return;
// todo: don't hardcode string getting weird ref error in iife when using process.env
let schedule: ReturnType<typeof setTimeout>;
let schedule: ReturnType<typeof requestAnimationFrame>;
let mounted = false;

const scheduleSetup = () => {
Expand All @@ -443,14 +443,14 @@ export const initReactScanInstrumentation = (setupToolbar: () => void) => {
if (schedule) {
clearTimeout(schedule);
}
schedule = setTimeout(() => {
schedule = requestAnimationFrame(() => {
mounted = true;
const host = getCanvasEl();
if (host) {
document.documentElement.appendChild(host);
}
setupToolbar();
}, 1000); // TODO(Alexis): perhaps a better timing
}); // TODO(Alexis): perhaps a better timing
};

const instrumentation = createInstrumentation('react-scan-devtools-0.1.0', {
Expand Down

0 comments on commit 97b9de6

Please sign in to comment.