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) {
    }, [setFocus, show2fa]);

Result: Breaks our Yup validation that we use in combination with useForm hook:

Attempt 2:

  const {
       formState: { errors },
   } = useForm({
       defaultValues: {} as loginFormType,
       resolver: yupResolver(loginFormSchema),

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



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