Legacy string ref
Part of Code Quality & Syntax, which counts for 20% of the overall score. When this check fires it deducts 8 points from that category, once per scan, no matter how many places it turns up.
What it detects
String refs (ref="name") are a legacy API with known issues around composition and are slated for removal. They cannot be typed and do not work with function components.
Why it matters
String refs (ref="name") are a legacy API with known problems: they do not compose, they cannot be typed in TypeScript, they do not work on function components, and the React team plans to remove them. Code using them will eventually stop working.
How to fix it
Use a ref object from useRef (function components) or React.createRef (class components), or a ref callback. Replace this.refs.name reads with the ref object current value.
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