July 2019
Intermediate to advanced
416 pages
10h 6m
English
The last bit of code we want to add to our client code base is the ability to handle client-side navigation. We saw how to do this when we covered Angular, so it's time for us to see how to display different pages based on the link the user selects. We are going to use a combination of Bootstrap navigation and React route manipulation. We start off by creating a router that contains our navigation:
const routing = ( <Router> <Navbar bg="light"> <Navbar.Collapse id="basic-navbar-nav"> <Nav.Link href="/">Home</Nav.Link> <Nav.Link href="/contacts">Contacts</Nav.Link> <Nav.Link href="/leads">Leads</Nav.Link> <Nav.Link href="/addresses">Addresses</Nav.Link> </Navbar.Collapse> </Navbar> </Router>)
We have left a home page ...
Read now
Unlock full access