fix(react): callback refs now work correctly with ionic components (#23152)

resolves #23153
This commit is contained in:
Tucker Whitehouse
2021-04-22 09:56:04 -04:00
committed by GitHub
parent 004885bfd4
commit 0dd189e2c0
14 changed files with 63 additions and 38 deletions

View File

@ -13,7 +13,7 @@ type Props = Omit<LocalJSX.IonBackButton, 'icon'> &
md: string;
}
| string;
ref?: React.RefObject<HTMLIonBackButtonElement>;
ref?: React.Ref<HTMLIonBackButtonElement>;
};
export const IonBackButton = /*@__PURE__*/ (() =>

View File

@ -18,7 +18,7 @@ type IonTabBarProps = LocalJSX.IonTabBar &
};
interface InternalProps extends IonTabBarProps {
forwardedRef?: React.RefObject<HTMLIonIconElement>;
forwardedRef?: React.ForwardedRef<HTMLIonIconElement>;
onSetCurrentTab: (tab: string, routeInfo: RouteInfo) => void;
routeInfo: RouteInfo;
}

View File

@ -8,7 +8,7 @@ import { IonTabButtonInner } from '../inner-proxies';
type Props = LocalJSX.IonTabButton &
IonicReactProps & {
routerOptions?: RouterOptions;
ref?: React.RefObject<HTMLIonTabButtonElement>;
ref?: React.Ref<HTMLIonTabButtonElement>;
onClick?: (e: any) => void;
};