Doug Doug - 6 months ago 52
React JSX Question

Read the current full URL with React?

How do I get the full URL from within a ReactJS component?

I'm thinking it should be something like

this.props.location
but it is
undefined

Answer

window.location.href is what you're looking for.