Skip to content

All topics  /  React

How to get window URL using ReactJs ?

React

Apr 20, 2020

Hello Dev,

Many times we need website url. so how to get window url in react. react get url domain. react js get url path. if you want to get react js current browser url then it's simple.

Get Path With Domain


window.location.href

Get Path Without Domain

window.location.pathname