Declaring a ref like this
const anchorRef = React.useRef<HTMLButtonElement>(null);
I get this error:
Type 'RefObject<HTMLButtonElement>' is not assignable to type '((instance: Ref<unknown>) => void) | RefObject<Ref<unknown>> | null | undefined'.
Type 'RefObject<HTMLButtonElement>' is not assignable to type 'RefObject<Ref<unknown>>'.
Type 'HTMLButtonElement' is not assignable to type 'Ref<unknown>'.
Property 'current' is missing in type 'HTMLButtonElement' but required in type 'RefObject<unknown>'.
Declaring a ref like this
const anchorRef = React.useRef<HTMLButtonElement>(null);
I get this error: