import React , { useContext , useLayoutEffect , useState } from 'react' ; import { XelemContext } from './Xwrapper' ; const useXarrow = ( ) => { const [ , setRender ] = useState ( { } ) ; const reRender = ( ) => setRender ( { } ) ; let updateXarrow = useContext ( XelemContext ) ; if ( ! updateXarrow ) updateXarrow = ( ) => { } ; useLayoutEffect ( ( ) => { updateXarrow ( ) ; } ) ; return reRender ; } ; export default useXarrow ;