Prop drilling
What a prop-drilling finding of fallow dead-code means, why it matters and how to fix it.
What it reports
A React/Preact prop is forwarded unchanged through 2 or more components to a distant consumer.
Dead code explains how fallow finds it.
Why it matters
A React/Preact prop is received by a component and forwarded unchanged to a child, which forwards it unchanged again, until a component uses it. One intermediate "pass-through" component is enough: the prop then passes unchanged through two components before the consumer. The high-confidence signal is that the received identifier appears only as the root of forwarded child-JSX attribute values (so <Child userName={user.name}/> counts: the prop user is projected forward), not the attribute name matching. fallow emits located per-chain records (the source, each pass-through hop, and the consumer with file + line + component name) so CI and an agent can act: colocate the consumer with the data, lift the value to a React context/provider at a mid-chain hop, or compose the component so the intermediates no longer thread the prop. This is a graph-derived health signal, not a correctness error. The rule defaults to off (opt-in), like private-type-leak and the security rules: enable it with prop-drilling: "warn" in rules. Set prop-drilling: "error" to enforce remaining chains in CI. Warnings remain advisory even with strict flags. File overrides resolve at the source hop and can activate the rule when the base setting is off. Suppressed or baselined chains do not gate. Zero false positives by construction: any {...props} spread, cloneElement, element-as-prop / render-prop / children-as-function, or context *.Provider anywhere in the chain abstains the whole chain, as does an ambiguous or unresolvable hop. The check runs only when the project declares react / react-dom / next / preact.
Example
Page receives user and renders <Layout user={user}/>; Layout only re-passes it to <Sidebar user={user}/>; Sidebar only re-passes it to <Profile user={user}/>, which finally reads user.name. The prop is drilled through Layout and Sidebar untouched.
Fix
Collapse the chain: colocate the consumer with the data, lift the value into a React context/provider at a mid-chain hop and consume it there, or compose the component (pass the rendered child as children) so the intermediates no longer thread the prop. Enable the rule with rules.prop-drilling = "warn" (it defaults to off). To accept one chain, suppress the source prop with // fallow-ignore-next-line prop-drilling.
Facts
| Fact | Value |
|---|---|
| Issue type | prop-drilling |
| Rule id in SARIF output | fallow/prop-drilling |
| Command | fallow dead-code |
| Default severity | off |
Config key in rules | prop-drilling |
| Suppression comment | // fallow-ignore-next-line prop-drilling |
Fixable with fallow fix | No |
| Opt-in | Yes |
Note. Opt-in: error gates CI; warn remains advisory even with --fail-on-issues. Defaults to off. Source-hop overrides decide severity.