Will It Vibe logoWill It Vibe?
REACT-011Low severity-4 points

useState initialized directly from props

Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 4 points from that category, once per scan, no matter how many places it turns up.

What it detects

Seeding useState with a prop value captures only the first render: later changes to that prop do not update the state, which silently desynchronizes the UI. Heuristic: intentionally uncontrolled defaults exist, so this is a low-confidence finding.

Why it matters

Initializing useState with a prop value copies that prop only on the first render. When the prop later changes, the state keeps the stale first value and the UI silently falls out of sync with the data. This is a heuristic because a deliberately uncontrolled initial value (an editable draft seeded from a prop) is a legitimate pattern.

How to fix it

If the value should track the prop, use the prop directly instead of copying it into state, or lift the state up. If you truly need a one-time seed, make that explicit and handle later prop changes deliberately (for example with a key that remounts the component, or an effect that resets state when the prop changes).

The paid report includes a ready-to-paste prompt for your AI coding agent for every check it finds, pointed at the exact findings from your scan. See pricing

Does your repo trip this check?

Paste a GitHub URL or drop a project folder. Scans run in your browser and take seconds.

Scan your repo

Related Code Quality & Syntax checks