import React, { ForwardedRef, forwardRef, useContext, useRef } from 'react'; import ActionSheet from './ActionSheet'; import { useTheme } from '../../theme'; interface IActionSheetProvider { Provider: any; Consumer: any; } const context: IActionSheetProvider = React.createContext({ showActionSheet: () => {}, hideActionSheet: () => {} }); export const useActionSheet = () => useContext(context); const { Provider, Consumer } = context; export const withActionSheet =
(Component: React.ComponentType
) =>
forwardRef((props: any, ref: ForwardedRef