Have the position always the specified element to be updated.
import { usePosition } from '@hitechline/reactools'; const Component = () => { const { ref, ...position } = usePosition(); return ( <div ref={ref}> My position is <span>{JSON.stringify(position)}</span> </div> ); };