debugsy 26.11.7 · React 19 · PolyForm Perimeter 1.0.1
A React debug panel that runs inside your app
debugsy is a React debug panel you mount in your own app: one ordered log of your debug messages, the changed values you track and render-count warnings.
npm i @n-uf/debugsy# then mount <DebugsyLook /> from a client component
session auth expired {"ttl":0}
refresh auth 5xx {"status":503}
refresh auth renewed {"expiresIn":3600}
session auth synced {"userId":42}
What the panel shows
One log inside your app
Your debug messages, changed values and render-count warnings in one ordered, virtualised log, in the page you're debugging.
const debug = useDebugsy()
debug.log("session", "synced", { userId })
dsy.warn("session", "expired", { ttl })
getDebugsy().error("refresh", "5xx", err)Which value changed
With Deps switched on, useWhyDidYouUpdate compares the values you pass with the previous render and logs each key that changed, with its old and new value.
useWhyDidYouUpdate("Form", { values, errors, onSubmit })Render count warnings
With Deps on (and trackRenders: true in 26.11), useRenderTracker warns when a component reaches its render threshold and calls your callback. It doesn't stop renders.
useRenderTracker("Modal", {
trackRenders: true, // needed in 26.11
renderThreshold: 10, // default
onExcessiveRenders: (info) => debug.warn("performance", "hot", info),
})Debug points by module
registerModule groups named debug points, like session and refresh under Auth, each with a label, an emoji and a description, so the log reads by area.
Values re-created every render
A function or object made anew on every render shows up as a "function changed" or "object changed" line with a running count, flagged FREQUENT once it keeps changing after start-up.
No telemetry
No network requests and nothing sent anywhere; settings stay in localStorage. Load it in development only to keep it out of production builds.
Install
Add the package
$ npm i @n-uf/debugsyNeeds React 19 (react and react-dom are peer dependencies).
Mount the panel
"use client"; import { DebugsyLook } from "@n-uf/debugsy"; export function DebugPanel() { return <DebugsyLook />; }Mount <DebugsyLook /> from a client component. That's the whole setup: no CSS import, no Tailwind, no bundler config.
Keep it out of production
if (process.env.NODE_ENV !== "production") { await import("@n-uf/debugsy") }It doesn't remove itself: load it only in development to keep it out of production builds.
Questions
What is a React debug panel?
A React debug panel is a panel inside your running app that shows what your components are doing. debugsy is one: you mount it in your own app, and it shows one ordered, virtualised log of your debug messages, the changed values you track and render-count warnings, in the page you're debugging.
How do I add a debug panel to a React app?
Install the package with npm i @n-uf/debugsy, then mount <DebugsyLook /> from a client component. That's the whole setup: no CSS import, no Tailwind and no bundler config. It needs React 19. Press ⌘+D (Ctrl+D) to show the panel and Esc to close it.
How do I keep a React debug panel out of production?
Load it only in development. debugsy doesn't remove itself, so import it behind a NODE_ENV check to keep it out of production builds. Its console command, window.debugsy, is also left off in production builds. It makes no network requests and sends no telemetry, and its settings stay in localStorage.
How can I see why a React component re-rendered?
Use useWhyDidYouUpdate. With Deps switched on, it compares the values you pass with the previous render and logs each key that changed, with its old and new value. useRenderTracker adds a warning when a component reaches its render threshold, and it calls your callback. It doesn't stop renders.
Does debugsy work with Next.js, Vite and Tailwind?
Yes. debugsy works in the Next.js App Router, in Vite and in other React 19 apps. It is client only, so import it from client components. The panel renders its own scoped stylesheet, so it looks the same in a Tailwind app and a plain one, and your app's CSS doesn't leak into it.
Read next
Use cases
How to debug state changes in React
Debug a state change in React: see when a value changed, what it changed to and which action did it, with DevTools, a hook, or debugsy.
How to check the React render count of a component
Check a React render count in the DevTools Profiler, with a useRef counter or the Profiler component, or with debugsy's useRenderTracker.
How to check which useEffect dependency changed
Check which useEffect dependency changed in React: compare the array with Object.is, paste a small hook, or log it with debugsy's useWhyDidYouUpdate.
All use casesArticles
How to debug a Next.js app, server and browser
Debug a Next.js app with --inspect, Chrome DevTools or VS Code: server and browser breakpoints, where logs show up, and why breakpoints stay gray.
How to use React DevTools, tab by tab
How to use React DevTools: install the extension, inspect and edit components, set up the Profiler, and fix a Components tab that won't show.
How to prevent unnecessary re-renders in React
How to prevent re-renders in React: measure first, move state down, pass children, use memo with stable props, and know what the Compiler changes.
All articles