TypeScript Common Error Problemd
Using ref Type 'MutableRefObject<HTMLInputElement | undefined>' is not assignable to type 'LegacyRef<HTMLInputElement> | undefined'
Solution:
const ref = React.useRef<HTMLInputElement>(null)