Okta Authentication - React JS

I’m beginner to React JS.
I need to authenticate the users when they load any pages(React JS).
Instead of having Login Button, i need to redirect to Okta Login Page when user load any pages.

Should i trigger props.auth.login(’/’); in componentDidMount() or componentWillMount() function.
Is it right way of doing.
Kindly suggest if there is any other better way.