There's a misleading error when using wrong the useRef hook.
function MyComponent() {
let nameRef = useRef();
return (
<div>
<input ref="nameRef" type="text" />
</div>
);
}
See the example here https://codesandbox.io/s/yvl21qm62j
The code above leads to this error Function components cannot have refs. Did you mean to use React.forwardRef()?. I'm moving some class components to Hooks, and stumbled upon this, and it took me a while due to the wrong error message.