Loading...
Loading...
Compare original and translation side by side
Skill by ara.so — Devtools Skills collection.
agent-react-devtools由ara.so开发的Skill——Devtools Skills合集。
agent-react-devtoolsnpm install -g agent-react-devtoolsnpx agent-react-devtools startnpm install -g agent-react-devtoolsnpx agent-react-devtools start@c1@c2<div><span>@c1@c2<div><span>npx agent-react-devtools initnpx agent-react-devtools uninitnpx agent-react-devtools initnpx agent-react-devtools uninitsrc/main.tsximport "agent-react-devtools/connect";src/main.tsximport "agent-react-devtools/connect";// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { reactDevtools } from "agent-react-devtools/vite";
export default defineConfig({
plugins: [
reactDevtools(), // Must come before react()
react()
],
});reactDevtools({ port: 8097, host: "localhost" })// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { reactDevtools } from "agent-react-devtools/vite";
export default defineConfig({
plugins: [
reactDevtools(), // 必须在react()之前
react()
],
});reactDevtools({ port: 8097, host: "localhost" })agent-react-devtools start
npx react-native startadb reverse tcp:8097 tcp:8097agent-react-devtools start
npx react-native startadb reverse tcp:8097 tcp:8097agent-react-devtools startagent-react-devtools start --port 8097agent-react-devtools statusagent-react-devtools stopagent-react-devtools startagent-react-devtools start --port 8097agent-react-devtools statusagent-react-devtools stopagent-react-devtools get treeagent-react-devtools get tree --depth 3agent-react-devtools get tree --allagent-react-devtools get tree @c5agent-react-devtools get component @c6@c6 [fn] TodoItem key=1
props:
id: 1
text: "Buy groceries"
done: false
onToggle: ƒ
hooks:
State: false
Callback: ƒagent-react-devtools find TodoItemagent-react-devtools find App --exactagent-react-devtools countagent-react-devtools errorsagent-react-devtools get treeagent-react-devtools get tree --depth 3agent-react-devtools get tree --allagent-react-devtools get tree @c5agent-react-devtools get component @c6@c6 [fn] TodoItem key=1
props:
id: 1
text: "Buy groceries"
done: false
onToggle: ƒ
hooks:
State: false
Callback: ƒagent-react-devtools find TodoItemagent-react-devtools find App --exactagent-react-devtools countagent-react-devtools errorsagent-react-devtools wait --connected --timeout 30agent-react-devtools wait --component App --timeout 30agent-react-devtools wait --connected --timeout 30agent-react-devtools wait --component App --timeout 30agent-react-devtools profile startagent-react-devtools profile start "user-interaction-test"agent-react-devtools profile stopagent-react-devtools profile slowagent-react-devtools profile slow --limit 5agent-react-devtools profile rerendersagent-react-devtools profile timelineagent-react-devtools profile commit 3agent-react-devtools profile commit #3agent-react-devtools profile report @c5agent-react-devtools profile export results.jsonagent-react-devtools profile diff before.json after.jsonagent-react-devtools profile diff before.json after.json --threshold 2.0agent-react-devtools profile startagent-react-devtools profile start "user-interaction-test"agent-react-devtools profile stopagent-react-devtools profile slowagent-react-devtools profile slow --limit 5agent-react-devtools profile rerendersagent-react-devtools profile timelineagent-react-devtools profile commit 3agent-react-devtools profile commit #3agent-react-devtools profile report @c5agent-react-devtools profile export results.jsonagent-react-devtools profile diff before.json after.jsonagent-react-devtools profile diff before.json after.json --threshold 2.0agent-react-devtools startagent-react-devtools start
2. Find the problematic component:
```bash
agent-react-devtools find UserProfileagent-react-devtools get component @c12agent-react-devtools get tree @c12 --depth 2
2. 找到有问题的组件:
```bash
agent-react-devtools find UserProfileagent-react-devtools get component @c12agent-react-devtools get tree @c12 --depth 2agent-react-devtools profile start "search-performance"agent-react-devtools profile stop
agent-react-devtools profile slow --limit 10
agent-react-devtools profile rerenders --limit 10agent-react-devtools profile report @c8agent-react-devtools profile start "search-performance"agent-react-devtools profile stop
agent-react-devtools profile slow --limit 10
agent-react-devtools profile rerenders --limit 10agent-react-devtools profile report @c8#!/bin/bash
agent-react-devtools start
agent-react-devtools wait --connected --timeout 30 || exit 1#!/bin/bash
agent-react-devtools start
agent-react-devtools wait --connected --timeout 30 || exit 1undefinedundefinedagent-browserundefinedagent-browserundefined
**Note**: Headless mode does NOT work - the DevTools connection requires a headed browser.
**注意**:无头模式无法工作——DevTools连接需要有头浏览器。REACT_DEVTOOLS_PORTREACT_DEVTOOLS_PORTagent-react-devtools start --port 9000agent-react-devtools start --port 9000agent-react-devtools statusagent-react-devtools stop
agent-react-devtools startagent-react-devtools statusagent-react-devtools stop
agent-react-devtools startreactDevtools()react()reactDevtools()react()agent-react-devtools get tree --allagent-react-devtools countagent-react-devtools get tree --allagent-react-devtools countagent-react-devtools profile stopagent-react-devtools profile stopagent-react-devtools wait --connected --timeout 60lsof -i :8097agent-react-devtools wait --connected --timeout 60lsof -i :8097@c1@c2⚠✗ƒ├─└─... +N more@c1@c2⚠✗ƒ├─└─... +N moreAGENTS.md.cursorrulesundefinedAGENTS.md.cursorrulesundefinedagent-react-devtoolsagent-react-devtools startagent-react-devtools statusagent-react-devtools get tree --depth 3agent-react-devtools get component @cNagent-react-devtools profile startprofile stopprofile slowstatusundefinedagent-react-devtoolsagent-react-devtools startagent-react-devtools statusagent-react-devtools get tree --depth 3agent-react-devtools get component @cNagent-react-devtools profile startprofile stopprofile slowstatusundefined