You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`npx agent-react-devtools init` performs both steps automatically for the
259
+
common CommonJS Metro configurations and entries it recognizes: `package.json`
260
+
`main`, Expo Router's root layout, bare `index.*`, and Expo `App.*`. It patches
261
+
all available platform-specific entries when a shared entry does not exist.
262
+
The CLI first preflights every target and leaves files unchanged when it cannot
263
+
safely identify the config or entry. `uninit` removes only its marked edits.
264
+
256
265
#### 1. Wrap the final Metro config
257
266
258
267
For a bare React Native app:
@@ -335,6 +344,13 @@ If `status` reports zero connected apps:
335
344
4. Confirm the daemon is listening on 8097 and repeat `adb reverse` for Android devices.
336
345
5. Check that the app is a development build.
337
346
347
+
#### Manual fallback
348
+
349
+
Configure the two steps above manually when Metro uses ESM (`.mjs`),
350
+
TypeScript, JSON or a package-field configuration; when your app starts Metro
351
+
with a custom `--config`; or when the CLI reports an ambiguous config or entry.
352
+
Keep `withAgentReactDevTools` as the final outermost wrapper.
353
+
338
354
## Using with agent-browser
339
355
340
356
When using `agent-browser` to drive the app (e.g. for profiling interactions), you **must use headed mode**. Headless Chromium does not properly execute the devtools connect script:
Copy file name to clipboardExpand all lines: packages/agent-react-devtools/skills/react-devtools/references/commands.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,11 @@ Categories with no changes are omitted. Keys are deduplicated across commits in
119
119
## Setup
120
120
121
121
### `agent-react-devtools init [--dry-run]`
122
-
Auto-detect the framework in the current directory. It configures Vite, Next.js, and CRA automatically. For Expo/React Native, it prints the required manual Metro-wrapper and entry-import steps without editing files.
122
+
Auto-detect the framework in the current directory. It configures Vite, Next.js,
123
+
CRA, and standard Expo/React Native projects automatically. For React Native it
124
+
patches existing CommonJS Metro configs (or creates one), then adds the native
125
+
bootstrap import to a recognized reachable app module. ESM, TypeScript, JSON or
126
+
package-field Metro configs, custom `--config` use, and ambiguous targets are
127
+
left unchanged with manual setup instructions.
123
128
124
129
Use `--dry-run` to preview changes without writing files.
0 commit comments