How to use the react-addons-perf.getMeasurementsSummaryMap function in react-addons-perf

To help you get started, we’ve selected a few react-addons-perf 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 adazzle / react-data-grid / src / __tests__ / Grid-perf.spec.js View on Github external
const onScrollComplete = (done) => {
  ReactPerf.stop();
  let measurements = ReactPerf.getLastMeasurements();

  let summary = ReactPerf.getMeasurementsSummaryMap(measurements);
  ReactPerf.printWasted(measurements);
  let summaryParser = new SummaryParser(summary);

  expect(summaryParser.getByComponent('Cell').wastedInstances <= 1000).toBeTruthy();
  done();
};