# Devtools React

> React adapter for the json-render devtools inspector.

React adapter for the json-render devtools inspector. Use whenever the user wants to add, configure, or troubleshoot @json-render/devtools-react in a React json-render app, including spec inspection, state editing, action and stream timelines, catalog browsing, or DOM picking.

- Page: https://ss33.ai/skills/vercel-labs/devtools-react-45819388821
- Publisher: vercel-labs
- Category: [Software Development](https://ss33.ai/skills/category/software-development-t44z8z) › [Developer docs & tooling](https://ss33.ai/skills/category/software-development-t44z8z/developer-docs-and-tooling-nich6w)
- License: Apache-2.0
- Source: https://github.com/vercel-labs/json-render/blob/72568f990e5502c4d3115691facb8ca928a5c9fc/skills/devtools-react/SKILL.md

## Skill

SKILL.md: https://ss33.ai/api/v1/ss33/download/vercel-labs/devtools-react-45819388821

# @json-render/devtools-react

React adapter for the json-render devtools panel. Read `skills/devtools/SKILL.md` for the shared panel capabilities, props, docking behavior, and server-side stream taps.

## Install

```bash
npm install @json-render/devtools @json-render/devtools-react
```

## Mount the panel

Mount `JsonRenderDevtools` inside the existing React json-render provider so it can observe the renderer's state, actions, and streams:

```tsx
import { JsonRenderDevtools } from "@json-render/devtools-react";

<JSONUIProvider registry={registry} handlers={handlers}>
  <Renderer spec={spec} registry={registry} />
  <JsonRenderDevtools spec={spec} catalog={catalog} messages={messages} />
</JSONUIProvider>;
```

The component renders nothing in production builds. The panel provides the shared devtools controls, including the `Ctrl`/`Cmd` + `Shift` + `J` shortcut.

## Imperative controls

Use `useJsonRenderDevtools` from any mounted React descendant:

```tsx
import { useJsonRenderDevtools } from "@json-render/devtools-react";

const devtools = useJsonRenderDevtools();
devtools?.open();
devtools?.toggle();
devtools?.recordEvent({ kind: "stream-text", at: Date.now(), text: "hi" });
```

The hook returns `null` in production or before the component has mounted. Keep server-side stream instrumentation in `@json-render/devtools`.
