Approach
Redirect will be implemented by using the react-router-dom package used to define routing in the react applications. It will redirect the user to the app component according to the defined paths and if the input path is not defined it will redirect the user to the home page.
How to redirect to another page in ReactJS ?
Redirect to another page in React JS refers to navigating to different components in the single page react app using the react-router-dom package. To switch between multiple pages react-router-dom t enables you to implement dynamic routing in a web page.