Here we are using react-router and react-router-dom library for navigation.
We have two routes defined, one is index '/' which renders the Counter
component
and other is '/five' which Renders the Five
component.
Modify the code inside Counter
component such that when counter value reaches five, it navigates to
'/five' automatically.