Como obter URL atual com JavaScript ou React
const currentURL = window.location.href // returns the absolute URL of a page
const pathname = window.location.pathname //returns the current url minus the domain name
Terrible Teira