how to know the current url in react code example Example: how to get url in react window.location.href