How to focus IonInput with setFocus method

I am trying to use the setFocus method but it’s not clear to me how to correctly call it without using useRef. (Tried solution from this post - Set focus to IonInput - #2 by mikrochipkid) The ref seems to be already used by our Yup validation, as it will render it as an error.

Attempt 1:

    useEffect(() => {
        if (show2fa) {
            twoFactorInput?.current?.setFocus();
        }
    }, [setFocus, show2fa]);

Result: Breaks our Yup validation that we use in combination with useForm hook: https://react-hook-form.com/api/useform

Attempt 2:

  const {
       register,
       handleSubmit,
       setFocus,
       resetField,
       formState: { errors },
   } = useForm({
       defaultValues: {} as loginFormType,
       resolver: yupResolver(loginFormSchema),
   });

   useEffect(() => {
       if (show2fa) {
           setFocus('twoFactorToken');
       }
   }, [setFocus, show2fa]);

....

 <IonInput
       {...register('twoFactorToken')}
 />

Result: No errors but the input never focusses.

Is there a maybe a way to call the ionic setFocus on the registered reference? I’m not sure how to find this.

Thanks a lot