How to use the scheduler/tracing.unstable_trace function in scheduler

To help you get started, we’ve selected a few scheduler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / react / fixtures / unstable-async / suspense / src / index.js View on Github external
handleReset = () => {
    trace('Clear cache', performance.now(), () => {
      // TODO: this is not implemented.
      // cache.invalidate();
      this.setState(state => ({
        requests: {},
      }));
      handleReset();
    });
  };
github facebook / react / packages / react-devtools-shell / src / app / InteractionTracing / index.js View on Github external
() => {
      trace('cascade', performance.now(), () => {
        setTimeout(
          wrap(() => {
            batchedUpdates(() => {
              setCount(count + 1);
              setShouldCascade(true);
            });
          }),
          count * 100,
        );
      });
    },
    [count],
github bvaughn / react-window / website / src / routes / examples / ScrollToItem.js View on Github external
scrollToRow300Center = () =>
    trace('scroll to row 300', performance.now(), () =>
      this.listRef.current.scrollToItem(300, 'center')
    );
github bvaughn / react-window / website / src / routes / examples / ScrollToItem.js View on Github external
scrollToRow250Smart = () => {
    trace('scroll to row 250', performance.now(), () =>
      this.listRef.current.scrollToItem(250, 'smart')
    );
  };
github ohansemmanuel / Reintroducing-react / 05-The-Profiler / fake-medium / src / components / Clap.js View on Github external
_handleClick () {
    trace('Clap was clicked!', window.performance.now(), () => {
      this._animationTimeline.replay()
      this.setState(function (prevState, nextState) {
        return {
          count: Math.min(prevState.count + 1, 50),
          countTotal: prevState.countTotal + 1,
          isClicked: true
        }
      })
    })
  }
github facebook / react / packages / react-devtools-shell / src / app / InteractionTracing / index.js View on Github external
() => {
      trace('first', performance.now(), () => {
        trace('second', performance.now(), () => {
          setTimeout(
            wrap(() => {
              setCount(count + 1);
            }),
            count * 100,
          );
        });
      });
    },
    [count],
github reduxjs / react-redux-benchmarks / sources / deeptree / src / configureStore.js View on Github external
const reactProfilerMiddleware = store => next => action => {
  const { type } = action;
  return trace(`[redux] ${type}`, performance.now(), () => next(action));
};
github bvaughn / react-window / website / src / routes / examples / ScrollToItem.js View on Github external
scrollToRow200Auto = () =>
    trace('scroll to row 200', performance.now(), () =>
      this.listRef.current.scrollToItem(200)
    );
  scrollToRow300Center = () =>
github facebook / react / fixtures / unstable-async / suspense / src / components / App.js View on Github external
handleBackClick = () =>
    trace('View list', performance.now(), () =>
      this.setState({
        currentId: null,
        showDetail: false,
      })
    );
github facebook / react / packages / react-devtools-shell / src / app / InteractionTracing / index.js View on Github external
() => {
      trace('count', performance.now(), () => {
        setTimeout(
          wrap(() => {
            setCount(count + 1);
          }),
          count * 100,
        );
      });
    },
    [count],