React
Function components cannot have string refs
React threw this error because a string ref was attached to a function component. String refs are legacy behavior and are not supported on modern function-component patterns.
React
React threw this error because a string ref was attached to a function component. String refs are legacy behavior and are not supported on modern function-component patterns.
Observed message
Function components cannot have string refs. We recommend using useRef() instead.
Why it happens
How to fix it
Official reference
React Docs: Minified React error #309Related errors
Explore more