get url react

JavaScript
window.location.href
Source

Also in JavaScript: