In my project based on type of application chosen by user, components have to rendered and further navigates to different routes. In all these applications the layout remains the same. I have to add the different components based on the routes. Home page main component
<Card>
<Card.Body>
<DYNAMIC_COMPONENT /> //based on application chosen
<button onClick={()=> takeToNextRoute}>CLICK ME</button>
<Card.body>
</Card>
based on button click in Home
, user will be taken to different routes based on Application type
<div>
<Router>
<Switch>
<Route exact path='/:{based on app}' component={dynamicCOMP}></Route>
<Route exact path='/about:{based on app}' component={dynamicCOMP1}></Route>
<Route exact path='/profile:{based on app}' component={dynamicCOMP2}></Route>
<Route exact path='/select:{based on app}' component={dynamicCOMP3}></Route>
</Switch>
</Router>
</div>
How to render the components in Home
dynamically based on application
chosen and then on button click
route to dynamic routes
with its dynamic components
? I am new to ReactJs and have no clue how to go about this.