
React Flow Code Review
- 274 installs
- 74 repo stars
- Updated July 21, 2026
- existential-birds/beagle
react-flow-code-review is a Claude Code skill that walks reviewers through five sequenced gates to audit @xyflow/react node editors for provider boundaries, memoization, and performance anti-patterns before merge.
About
react-flow-code-review is a beagle-react skill from the existential-birds/beagle marketplace that structures agent-led reviews of React Flow (@xyflow/react) code before merge. The workflow runs five sequenced gates: locate flow symbols like ReactFlow, ReactFlowProvider, useReactFlow, nodeTypes, and edgeTypes; verify provider boundaries for hook usage; check stable nodeTypes and edgeTypes references and memo surfaces; collect file:line evidence for each finding; and close performance and common-mistakes checklists with satisfied, N/A, or open status. It targets the usual footguns—inline nodeTypes that remount every node, missing memo wrappers, and useReactFlow called outside ReactFlowProvider. Developers reach for react-flow-code-review when reviewing PRs that touch flow builders, diagram editors, or node-based canvases in React apps. The skill ships as part of beagle-react alongside 16 React-focused review skills in the beagle plugin marketplace.
- Five sequenced review gates from locating flow code through checklist closure
- Provider-boundary checks for useReactFlow vs ReactFlowProvider with file:line citations
- Stable nodeTypes/edgeTypes and memo surfaces flagged when recreated each render
- Performance and anti-pattern checklists with evidence required for critical/high findings
- Scoped search for ReactFlow, nodeTypes, edgeTypes, and @xyflow/react imports
React Flow Code Review by the numbers
- 274 all-time installs (skills.sh)
- Ranked #289 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/existential-birds/beagle --skill react-flow-code-reviewAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 274 |
|---|---|
| repo stars | ★ 74 |
| Security audit | 3 / 3 scanners passed |
| Last updated | July 21, 2026 |
| Repository | existential-birds/beagle ↗ |
How do you review @xyflow/react code before merge?
Run a structured React Flow (@xyflow/react) review before merge when your app uses node editors, diagrams, or flow builders.
Who is it for?
Frontend engineers reviewing pull requests that add or change React Flow node editors, diagram builders, or @xyflow/react canvas components.
Skip if: Teams without @xyflow/react in the codebase or reviewers who only need generic React/TypeScript linting without flow-specific gates.
When should I use this skill?
A pull request touches ReactFlow, ReactFlowProvider, useReactFlow, nodeTypes, edgeTypes, or @xyflow/react imports and needs a structured pre-merge review.
What you get
A sequenced review report with file:line findings, provider-boundary checks, memoization audit results, and closed performance and common-mistakes checklists.
- Sequenced review report
- File:line finding citations
- Closed performance and common-mistakes checklist
By the numbers
- Runs 5 sequenced review gates before closing performance and common-mistakes checklists
- Searches review scope for 6 React Flow symbols including nodeTypes and edgeTypes
- Ships inside beagle-react with 16 React-focused skills in the beagle marketplace
Files
React Flow Code Review
When reviewing React Flow code, complete the gates below in order. Each step has an objective pass condition before moving on.
Review gates (sequenced)
1. Locate flow code — Search the review scope for ReactFlow, ReactFlowProvider, useReactFlow, @xyflow/react, nodeTypes, and edgeTypes. Pass: a short list of file paths (or explicit “none in scope” after searching).
2. Provider boundary — For each useReactFlow() (and other hooks that require the provider), trace the component tree to an enclosing ReactFlowProvider, or record a concrete mismatch with file:line.
3. Stable types and memo surfaces — For each custom node or edge component, note whether it uses memo and typed props (NodeProps<...>, etc.). For each nodeTypes / edgeTypes value passed into <ReactFlow>, confirm a stable reference (module scope, or useMemo with deps you can point to) or flag unstable recreation with file:line.
4. Report with evidence — For each finding you will deliver, record file path and line number(s) (or a minimal quoted snippet). Pass: no critical or high-severity issue is stated without that citation.
5. Close the checklists — Use Performance Checklist and Common Mistakes; each item is satisfied, not applicable (with reason), or open with evidence. Pass: no item left silently ambiguous.
Critical Anti-Patterns
1. Defining nodeTypes/edgeTypes Inside Components
Problem: Causes all nodes to re-mount on every render.
// BAD - recreates object every render
function Flow() {
const nodeTypes = { custom: CustomNode }; // WRONG
return <ReactFlow nodeTypes={nodeTypes} />;
}
// GOOD - defined outside component
const nodeTypes = { custom: CustomNode };
function Flow() {
return <ReactFlow nodeTypes={nodeTypes} />;
}
// GOOD - useMemo if dynamic
function Flow() {
const nodeTypes = useMemo(() => ({ custom: CustomNode }), []);
return <ReactFlow nodeTypes={nodeTypes} />;
}2. Missing memo() on Custom Nodes/Edges
Problem: Custom components re-render on every parent update.
// BAD - no memoization
function CustomNode({ data }: NodeProps) {
return <div>{data.label}</div>;
}
// GOOD - wrapped in memo
import { memo } from 'react';
const CustomNode = memo(function CustomNode({ data }: NodeProps) {
return <div>{data.label}</div>;
});3. Inline Callbacks Without useCallback
Problem: Creates new function references, breaking memoization.
// BAD - inline callback
<ReactFlow
onNodesChange={(changes) => setNodes(applyNodeChanges(changes, nodes))}
/>
// GOOD - memoized callback
const onNodesChange = useCallback(
(changes) => setNodes((nds) => applyNodeChanges(changes, nds)),
[]
);
<ReactFlow onNodesChange={onNodesChange} />4. Using useReactFlow Outside Provider
// BAD - will throw error
function App() {
const { getNodes } = useReactFlow(); // ERROR: No provider
return <ReactFlow ... />;
}
// GOOD - wrap in provider
function FlowContent() {
const { getNodes } = useReactFlow(); // Works
return <ReactFlow ... />;
}
function App() {
return (
<ReactFlowProvider>
<FlowContent />
</ReactFlowProvider>
);
}5. Storing Complex Objects in Node Data
Problem: Reference equality checks fail, causing unnecessary updates.
// BAD - new object reference every time
setNodes(nodes.map(n => ({
...n,
data: { ...n.data, config: { nested: 'value' } } // New object each time
})));
// GOOD - use updateNodeData for targeted updates
const { updateNodeData } = useReactFlow();
updateNodeData(nodeId, { config: { nested: 'value' } });Performance Checklist
Node Rendering
- [ ] Custom nodes wrapped in
memo() - [ ] nodeTypes defined outside component or memoized
- [ ] Heavy computations inside nodes use
useMemo - [ ] Event handlers use
useCallback
Edge Rendering
- [ ] Custom edges wrapped in
memo() - [ ] edgeTypes defined outside component or memoized
- [ ] Edge path calculations are not duplicated
State Updates
- [ ] Using functional form of setState:
setNodes((nds) => ...) - [ ] Not spreading entire state for single property updates
- [ ] Using
updateNodeDatafor data-only changes - [ ] Batch updates when adding multiple nodes/edges
Viewport
- [ ] Not calling
fitView()on every render - [ ] Using
fitViewOptionsfor initial fit only - [ ] Animation durations are reasonable (< 500ms)
Common Mistakes
Missing Container Height
// BAD - no height, flow won't render
<ReactFlow nodes={nodes} edges={edges} />
// GOOD - explicit dimensions
<div style={{ width: '100%', height: '100vh' }}>
<ReactFlow nodes={nodes} edges={edges} />
</div>Missing CSS Import
// Required for default styles
import '@xyflow/react/dist/style.css';Forgetting nodrag on Interactive Elements
// BAD - clicking button drags node
<button onClick={handleClick}>Click</button>
// GOOD - prevents drag
<button className="nodrag" onClick={handleClick}>Click</button>Not Using Position Constants
// BAD - string literals
<Handle type="source" position="right" />
// GOOD - type-safe constants
import { Position } from '@xyflow/react';
<Handle type="source" position={Position.Right} />Mutating Nodes/Edges Directly
// BAD - direct mutation
nodes[0].position = { x: 100, y: 100 };
setNodes(nodes);
// GOOD - immutable update
setNodes(nodes.map(n =>
n.id === '1' ? { ...n, position: { x: 100, y: 100 } } : n
));TypeScript Issues
Missing Generic Types
// BAD - loses type safety
const [nodes, setNodes] = useNodesState(initialNodes);
// GOOD - explicit types
type MyNode = Node<{ value: number }, 'custom'>;
const [nodes, setNodes] = useNodesState<MyNode>(initialNodes);Wrong Props Type
// BAD - using wrong type
function CustomNode(props: any) { ... }
// GOOD - correct props type
function CustomNode(props: NodeProps<MyNode>) { ... }Review Questions
1. Are all custom components memoized? 2. Are nodeTypes/edgeTypes defined outside render? 3. Are callbacks wrapped in useCallback? 4. Is the container sized properly? 5. Are styles imported? 6. Is useReactFlow used inside a provider? 7. Are interactive elements marked with nodrag? 8. Are types used consistently throughout?
Related skills
How it compares
Pick react-flow-code-review over generic frontend review skills when the diff uses @xyflow/react and you need flow-specific provider, memoization, and nodeTypes stability checks.
FAQ
What does react-flow-code-review check in @xyflow/react code?
react-flow-code-review runs five sequenced gates: locate flow symbols, verify ReactFlowProvider boundaries for useReactFlow, audit stable nodeTypes and edgeTypes plus memo surfaces, record file:line evidence, and close performance and common-mistakes checklists before merge.
When should I invoke react-flow-code-review?
Invoke react-flow-code-review when a pull request modifies React Flow canvases, custom node or edge components, nodeTypes maps, or hook usage around ReactFlowProvider—especially before merging diagram-builder or flow-editor features.
How is react-flow-code-review installed?
Install react-flow-code-review with npx skills add https://github.com/existential-birds/beagle --skill react-flow-code-review, or install the beagle-react plugin from the existential-birds/beagle Claude Code marketplace.
Is React Flow Code Review safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.