Functions on ActionSheetProvider ref are all undefined
I created an exportable ref with
export const actionSheetRef = React.createRef<ActionSheetProvider>(), and applied it to the ActionSheetProvider.
When I then try to access it, using either actionSheetRef.current or actionSheetRef.current._actionSheetRef.current, all the typed functions don't seem to be accessible, even though the typescript definition file shows this:
export default class ActionSheet extends React.Component<Props, State> {
static defaultProps: {
useNativeDriver: boolean;
};
_actionSheetHeight: number;
state: State;
_deferNextShow?: () => void;
_setActionSheetHeight: ({ nativeEvent }: any) => any;
render(): JSX.Element;
_renderSheet(): JSX.Element | null;
showActionSheetWithOptions: (options: ActionSheetOptions, onSelect: (i: number) => void) => void;
_selectCancelButton: () => boolean;
_onSelect: (index: number) => boolean;
_animateOut: () => boolean;
}
I'd like to programatically close the action sheet using either _animateOut or _selectedCancelButton, but accessing that key returns undefined.
Has anyone had any luck getting ref to work properly?
I haven't tested this, but we probably need to tap into the imperative ref hook that would expose those internal methods to a parent.