Visualize React prop flow and eliminate prop drilling confusion
Features β’ Installation β’ Usage β’ Demo β’ Contributing
In large React applications, tracing where props originate becomes a time-consuming manual process:
- You see a prop being used:
<Button variant={variant} /> - You navigate to the parent to find where
variantcomes from - The parent passes
variant={type}- it's renamed! - You navigate to the grandparent
- Repeat 5-10 times until you find the source
PropFlow solves this by showing you the complete propflow lineage instantly, right where you need it.
Hover over any prop to see the complete data flow from source to destination.
Visual hierarchical sidebar showing the full component chain.
- π’ SOURCE - Where data originates (literal values)
- π΅ USAGE - Pass-through components
- π£ DEFINITION - Current component
Jump directly to any component in the chain with one click.
- Sub-second tracing for 5+ level deep chains
- Pull-based analysis (on-demand only)
- Efficient AST parsing with ts-morph
- Leverages VS Code's native language server
- β
Prop renaming:
<Child name={props.title} /> - β
Prop spreading:
<Child {...props} /> - β
Destructured props:
function Comp({ a, b }) - β Default & named exports
- β Import aliases
- Open VS Code
- Press
Ctrl+Shift+X(orCmd+Shift+Xon Mac) - Search for "PropFlow"
- Click Install
- Download the latest
.vsixfile from Releases - Open VS Code
- Press
Ctrl+Shift+Pβ Type "Install from VSIX" - Select the downloaded file
git clone https://github.com/rutpshah/propflow.git
cd propflow
npm install
npm run compile
npm run package
code --install-extension propflow-<version>.vsix- Open any React component file (
.tsx,.jsx) - Hover over a prop in the component parameters
- See the complete flow instantly
Example:
function Button({ label }) {
// β Hover over "label"
return <button>{label}</button>;
}Result:
π’ App (SOURCE)
ββ prop: "Click Me"
β
π΅ Card
ββ prop: "buttonText" β "label"
β
π£ Button
ββ prop: "label"
- Place cursor on a prop
- Press
Ctrl+Shift+P(Cmd+Shift+Pon Mac) to open the Command Palette - Type "PropFlow: Show Lineage" and press Enter
- View the tree in the PropFlow Lineage sidebar
Optional: Add a custom keyboard shortcut:
- Open Keyboard Shortcuts:
Ctrl+Shift+P/Cmd+Shift+Pβ "Preferences: Open Keyboard Shortcuts" - Search for "PropFlow: Show Lineage"
- Click
+to add a keybinding (e.g.,Ctrl+Alt+Pon Windows/Linux orCmd+Alt+Pon Mac)
Look for the β¬ Trace Props link above component definitions and click it. From notification click on "View in PropFlow Lineage Panel" to see the details in sidebar panel.
PropFlow works without keyboard shortcuts via hover and CodeLens. If you want a keyboard shortcut, add this to your keybindings.json:
{ "key": "cmd+alt+p", "command": "propflow.showLineage", "when": "editorTextFocus" }
File Structure:
App.tsx β Card.tsx β Button.tsx
App.tsx:
function App() {
return <Card title="Welcome" buttonLabel="Click Me" />;
}Card.tsx:
function Card({ title, buttonLabel }) {
return (
<div>
<h2>{title}</h2>
<Button label={buttonLabel} />
</div>
);
}Button.tsx:
function Button({ label }) {
return <button>{label}</button>;
}PropFlow Output:
π’ App (SOURCE)
ββ prop: "Click Me"
β
π΅ Card
ββ prop: "buttonLabel" β renamed to "label"
β
π£ Button
ββ prop: "label" (CURRENT)
Parent.tsx:
function Parent() {
const userName = "Alice";
return <Child displayName={userName} />;
}Child.tsx:
function Child({ displayName }) {
return <div>Hello, {displayName}</div>;
}PropFlow Output:
π’ Parent (SOURCE)
ββ prop: userName β renamed to "displayName"
β
π£ Child
ββ prop: "displayName"
PropFlow works out-of-the-box with zero configuration. Optional settings:
{
"propflow.maxTraceDepth": 20,
"propflow.enableHoverProvider": true,
"propflow.enableCodeLens": true,
"propflow.traceTimeout": 5000
}| Setting | Default | Description |
|---|---|---|
maxTraceDepth |
20 |
Maximum levels to trace (prevents infinite loops) |
enableHoverProvider |
true |
Show hover tooltips |
enableCodeLens |
true |
Show CodeLens links above components |
traceTimeout |
5000 |
Timeout for trace operations (ms) |
βββββββββββββββββββββββββββββββββββββββββββ
β VS Code Extension β
βββββββββββββββββββββββββββββββββββββββββββ€
β Hover Provider β Command Handlers β
β CodeLens β Tree View Provider β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Graph Builder β
β β’ Recursive prop chain construction β
β β’ Workspace-wide JSX search β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β AST Analyzer (ts-morph) β
β β’ Parse TypeScript/JavaScript β
β β’ Extract components and props β
β β’ Find JSX element attributes β
βββββββββββββββββββββββββββββββββββββββββββ
function buildPropChain(filePath, componentName, propName):
1. Create root node: { component, prop, type: DEFINITION }
2. Find parent component using workspace search
3. Parse parent's JSX to find prop usage
4. Determine if source (literal) or usage (variable)
5. If usage, recursively trace parent's parent
6. Return complete chain from source β currentfunction findComponentUsages(componentName):
1. Search all .tsx/.jsx files for `<ComponentName`
2. Return file paths and line numbers
3. Filter out false positives (comments, strings)function findPropUsage(sourceFile, componentName, propName):
1. Get all JSX elements in file
2. Find elements matching componentName
3. Extract attributes from matching element
4. Look for propName in attributes
5. Return prop value (literal or expression)npm testnpm run coveragetest/
βββ suite/
β βββ index.ts # Test runner setup
βββ extension.test.ts # Extension activation tests
βββ astAnalyzer.test.ts # AST parsing tests
βββ graphBuilder.test.ts # Prop chain building tests
Current Coverage: 15 passing tests
- 5 Extension integration tests
- 6 AST analyzer tests
- 4 Graph builder tests
- Node.js 18+
- VS Code 1.85.0+
- npm or yarn
# Clone repository
git clone https://github.com/rutpshah/propflow.git
cd propflow
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch- Open the project in VS Code
- Press
F5to start debugging - A new VS Code window opens with the extension loaded
- Test your changes in the Extension Development Host
# Compile
npm run compile
# Run tests
npm test
# Package extension
npm run packageThis creates propflow-<version>.vsix ready for distribution.
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Write tests for new functionality
- Ensure tests pass:
npm test - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
- π― Context API tracing - Trace
useContextvalues - π― Redux integration - Trace store connections
- π― Class component support - Handle legacy codebases
- π― Performance improvements - Optimize for monorepos
- π― Documentation - Improve guides and examples
- π― Bug fixes - Check Issues
- Use TypeScript for all new code
- Follow existing code style (ESLint)
- Add JSDoc comments for public APIs
- Write meaningful commit messages
We use conventional commits:
feat:- New featurefix:- Bug fixdocs:- Documentation onlyrefactor:- Code change that neither fixes a bug nor adds a featuretest:- Adding or updating testschore:- Maintenance tasks
When a component is used in multiple places, PropFlow currently shows the trace from the first parent found. Use VS Code's "Find All References" to see all usages, then trace each parent individually.
Coming in v1.2: View all parent chains simultaneously.
β Not Supported:
- Context API (
useContext) - Redux/Zustand store connections
- Class components
- Dynamic/computed prop names
- Props from external libraries (stops at boundary)
β Supported:
- Function components
- Hooks-based components
- Destructured props
- Prop spreading
- Prop renaming
- Default & named exports
See Issues for active bugs and feature requests.
- Context API support
- Redux store tracing
- Configurable color schemes
- Prop documentation in hover tooltip
- Class component support
- Prop type information in trace
- Export diagrams as PNG/SVG
- Multi-root workspace support
- Vue.js component tracing
- Angular component tracing
- Real-time collaboration features
- AI-powered prop usage suggestions
MIT License - see LICENSE file for details.
Your Name
- ts-morph - For excellent TypeScript AST manipulation
- VS Code Extension API - For comprehensive IDE integration
- React community - For inspiration and feedback
- Star this repo on GitHub
- Suggest features - Have an idea? We'd love to hear it (Refer to
feature_request.mdtemplate) - Improve docs - Typos, clarifications, examples
- Issues: GitHub Issues (Refer to
bug_report.mdtemplate) - Discussions: GitHub Discussions
- Email: hello@rutpshah.com
If this extension saves you time, consider:
If PropFlow saves you time, please β star the repo!
Made with β€οΈ for developers




