import { useContext } from 'react' ; import { ExtendedResizeObserverEntry } from '@envato/react-resize-observer-hook' ; import { Context } from './Context' ; example export const useResizeObserverEntry = ( injectResizeObserverEntry ? ) : ExtendedResizeObserverEntry | null => { const resizeObserverEntry = useContext < ExtendedResizeObserverEntry | null > ( Context ) ; return injectResizeObserverEntry || resizeObserverEntry ; } ;