Vite plugin that enables clicking on React components in the browser to open their source code in your local IDE. Current stable version is 0.3.3, released in July 2024. It supports React 16, 17, and 18, and works out of the box with Vite. Unlike Chrome inspector, it jumps directly to the component's source file and line. The plugin must be placed before the React plugin in vite.config.ts. It uses the REACT_EDITOR environment variable to specify the IDE. Inspired by vite-plugin-vue-inspector.
npm install vite-plugin-react-inspectorVerified import paths — ran on the pinned version, not inferred.
Shows how to configure vite.config.ts with ReactInspector plugin placed before @vitejs/plugin-react and set the REACT_EDITOR environment variable.
Reorder plugins so ReactInspector() comes before react().
Upgrade to 0.3.3+ which fixes Windows path handling.
Upgrade to 0.3.3+ for React Fragment support.
Set REACT_EDITOR in your shell profile (e.g., export REACT_EDITOR=code).
Use only with Vite; for Webpack consider react-dev-inspector.
Run: npm install vite-plugin-react-inspector -D
Use: import ReactInspector from 'vite-plugin-react-inspector'
Swap plugin order: ReactInspector() before react().
Set REACT_EDITOR to your editor command (e.g., 'code' for VS Code).
No dependency data recorded yet.