score:4

Accepted answer
import React from 'react';

class Connexion extends React.Component {

    render() {
        return (
            <h1> the URL is {window.location.pathname} </h1>
        )
    }
}

score:0

this.props.location.pathname

score:1

return (
    <h1> the URL is {this.context.location.pathname} </h1>
)

Related Query

More Query from same tag