How to use the react-imported-component/dist/es2015/marks.rehydrateMarks function in react-imported-component

To help you get started, we’ve selected a few react-imported-component 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 theKashey / react-imported-component / examples / hybrid / react-snap / src / main.js View on Github external
import {rehydrateMarks} from 'react-imported-component/dist/es2015/marks';
import './imported-chunk';
import './app';

function hereTime(prefix) {
  var perfData = window.performance.timing;
  var pageLoadTime = Date.now() - perfData.navigationStart;
  console.log(prefix, pageLoadTime);
}

hereTime('root');

rehydrateMarks(window.__IMPORTED_COMPONENTS__).then(() => hereTime('chunks loaded'));