how to get current url in class component in react code example Example: get url react window.location.href