import {createContext, type RefObject, useContext} from 'react'; type DrawerContainerRef = RefObject | null; export const DrawerContainerRefContext = createContext(null); export const useDrawerContainerRef = () => { const context = useContext(DrawerContainerRefContext); if (context === null) { throw new Error( 'useDrawerContainerRef must be used within DrawerContainerRefContext.Provider' ); } return context; };