import { createContext , ReactNode , ReactPortal } from 'react' ; export interface PortalContextType { createPortal : ( element : ReactNode , key ? : null | string | number ) => ReactPortal ; } export const PortalContext = createContext < PortalContextType | undefined > ( undefined ) ;