Hello I am learning React js and I have came across a problem. When I try to change back to the main page using react router i get the following error:
Uncaught TypeError: Cannot read property 'push' of undefined
Here is my code, as you can see I am calling the navigate function:
My client.js with router:
If I replace this.props.router.push('/');
with this.props.history.push('/');
it works fine.
What could be the problem?