I have a page which renders different components based on user input. At the moment, I have hard coded the imports for each component as shown below:
imp
You can use Route and Switch from 'react-router-dom' to dynamically render components based on the path. Here is the sample
render() { return ( <> ()}/> ()}/> ()}/> > ); }