Show HN: React Source Lens – Jump from UI components to source code in one click

Share This Post

React Source Lens is a development tool that lets you inspect React component source code directly in the browser.

How it works:

Add
useReactSourceLens()
to your React app
Hover over any component in your app
Press Cmd+Shift+O (Mac) or Ctrl+Shift+O (Windows/Linux)
A modal appears with the file path and line number
Click “Open in VS Code” to jump directly to the source code
Key features:

Visual overlay shows which component you’re hovering over
Works with React’s debug information (development mode)
Optional Babel plugin for enhanced source detection
VS Code integration with vscode:// protocol
Toggle overlay with Cmd+Shift+L
Installation:

npm install react-source-lens
Usage:

javascript
import { useReactSourceLens } from ‘react-source-lens’;

// Basic usage
useReactSourceLens();

// With VS Code integration
useReactSourceLens({
projectRoot: ‘/path/to/your/project’
});
Why it matters: When working on large or unfamiliar React codebases, finding component definitions can be time-consuming. This tool eliminates that friction by providing instant source code navigation.

Built with modern React and works with Vite, Create React App


Comments URL: https://news.ycombinator.com/item?id=45866064

Points: 1

# Comments: 0

Source: www.npmjs.com

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Windows Securitym Hackers Feeds

Mysterious holes in the Andes may have been an ancient marketplace

Article URL: https://www.sydney.edu.au/news-opinion/news/2025/11/10/mysterious-holes-in-the-andes-may-have-been-an-ancient-marketplace-new-research-suggests.html Comments URL: https://news.ycombinator.com/item?id=45871077 Points: 1 # Comments: 0 Source: www.sydney.edu.au

Do You Want To Boost Your Business?

drop us a line and keep in touch

We are here to help

One of our technicians will be with you shortly.