This Component is forked from vigneshshanmugam/react-memorystats, which mainly fixes the issue caused by ssr by importing by dynamic import and making the statsStyle
as the local variable.
yarn add next-react-memory-stats
import dynamic from "next/dynamic";
const MemoryStatsComponent = dynamic(
() => import("next-react-memory-stats"),
{ ssr: false }
)
function Component() {
return (
<MemoryStatsComponent corner="topLeft" />
);
}
- corner - topLeft, topRight (default), bottomLeft, bottomRight
# Linux
google-chrome --enable-precise-memory-info --enable-memory-info
#MacOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --enable-precise-memory-info --enable-memory-info
Otherwise the results from performance.memory are bucketed and less useful.
// install dependencies
yarn install
// run example locally and start server
yarn start