import type { Context } from 'react' ; import { useContext as useReactContext } from 'react' ; import { SDKError } from './error' ; description export const useContext = < T > ( context ) => { const value = useReactContext ( context ) ; if ( value !== undefined ) { return value ; } throw new SDKError ( `${ context . displayName ?? 'Context' } needs to be on the React tree` ) ; } ;