> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.


# Preact Devtools Panel

The **Preact Devtools** panel helps you inspect the hierarchy of ReactLynx components, displaying information such as component props, state, and file paths. The Preact Devtools panel is based on the [Preact Devtools](https://preactjs.github.io/preact-devtools/) web browser extension and offers the same user experience.

## Overview

With the **Preact Devtools** panel, you can:

- View the component hierarchy of ReactLynx
- Modify props or state and see real-time updates
- Use ClickToComponent to navigate to component source code
- Use the Profiler to analyze application performance

### Open the Preact Devtools Panel

In the DevTool window, click the Preact Devtools tab in the main panel to open it.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/open-preact-devtools.jpg)
Note: Before using the **Preact Devtools** panel, you need to import [`@lynx-js/preact-devtools`](https://www.npmjs.com/package/@lynx-js/preact-devtools) at the **first line** of your ReactLynx application's entry file:

```js
import '@lynx-js/preact-devtools';
```

Development builds (`rspeedy dev`) ship the runtime hooks the panel needs. Production builds (`rspeedy build`) strip them, along with `@lynx-js/preact-devtools` itself. To inspect a production build, set `REACT_DEVTOOL=true` when you build it:

```bash
REACT_DEVTOOL=true rspeedy build
```

:::info
`REACT_DEVTOOL` requires `@lynx-js/react-rsbuild-plugin@0.17.2` or later (which ships `@lynx-js/react-webpack-plugin@0.9.5`). Earlier versions always strip the hooks from production builds.
:::

## View Component Hierarchy

The left side of the **Preact Devtools** panel shows the complete hierarchy of the ReactLynx application, while the right side displays detailed information about the selected component, including its props, state, and file path.

Hover over a component to highlight its corresponding box model in the preview window on the left.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/component-hierarchy.jpg)
## View and Modify Props or State

On the right side of the **Preact Devtools** panel, you can directly modify the props or state of components, and the ReactLynx application's UI will update in real-time.

As shown below, we changed the state used for counting in the `Counter` component from `1` to `2`, and the counter UI on the page also changed from `1` to `2`.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/state-modify.jpg)
## ClickToComponent for Source Navigation

We integrated the [ClickToComponent](https://github.com/ericclemmons/click-to-component) into the **Preact Devtools** panel. By clicking the file path under **source location**, VSCode will automatically open the file containing the component and navigate to the corresponding line and column.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/ClickToComponent.jpeg)
## Profiler

The Profiler panel supports performance analysis of ReactLynx component rendering time on background thread. Click the button in the top-left corner to start recording, let the application run for a while, and then click the button again to stop. You will then get information about all Preact commits during that time, as well as the rendering time of each component within the same commit.

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/preact-devtools-profiler.jpg)