Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ module.exports = merge(common, {
chunkFilename: '[id].css',
}),
],
resolve: {
alias: {
'react-dom$': 'react-dom/profiling',
}
},

module: {
rules: [
Expand Down
15 changes: 9 additions & 6 deletions src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//import '@babel/polyfill';
//import 'regenerator-runtime/runtime';

import React from "react";
import React, { Profiler } from "react";
import ReactDOM from "react-dom";

// Note: Using an Alias in Webpack
Expand All @@ -17,13 +17,16 @@ class App extends React.Component {

return (
<div>
<Header />
<Menu />
<Bottom />

<Profiler id="TEST" onRender={(_, phase) => {
console.log('phase', phase)
}}>
<Header />
<Menu />
<Bottom />
</Profiler>
</div>
);
}
}

export default App;
export default App;