import React from 'react' ; import { ReactContext } from './teleportContextProvider' ; export default function useTeleport ( ) { const teleportContext = React . useContext ( ReactContext ) ; if ( ! teleportContext ) { throw new Error ( 'Unable to retrieve Teleport Context' ) ; } return ( window [ 'teleContext' ] = teleportContext ) ; }