use-show-window-size shows window size during development.
- TypeScript support
- SSR support
npm i --save use-show-window-size
"use client";
import useShowWindowSize from "@/hooks/useShowWindowSize";
import { ReactNode } from "react";
export type LayoutProps = {
children: ReactNode;
};
export default function Layout({ children }: LayoutProps): JSX.Element {
useShowWindowSize({
disable: process.env.NODE_ENV === "production",
});
return <>{children}</>;
}
Argument | Type | Optional |
---|---|---|
disable | Boolean | ✓ |
style | Partial<CSSStyleDeclaration> | ✓ |
void