next-cache-toolbar
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

next-cache-toolbar Version

A toolbar that helps to identify data cache entries

Example

Preview cached body

Example

Use

next-cache-toolbar requires to use app router

Create file that we will lazy loading later to avoid bundling next-cache-toolbar in production

// app/toolbar.jsx
import { NextCacheToolbar } from "next-cache-toolbar";
import "next-cache-toolbar/style.css";

export default function Toolbar() {
	return <NextCacheToolbar />;
}
// app/layout.jsx
let Toolbar: React.ComponentType = () => null;

if (process.env.NODE_ENV === "development") {
	Toolbar = dynamic(() => import("./toolbar"));
}

export default function Layout({ children }) {
  return (
    <html>
      <head/>
      <body>
        {children}
        <Toolbar />
      </body>
    </html>
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i next-cache-toolbar

Weekly Downloads

90

Version

0.2.1

License

MIT

Unpacked Size

85.3 kB

Total Files

26

Last publish

Collaborators

  • theheyl