I'm trying to place a navbar on the top of all of my pages. Here's the router:
App = React.createClass({
render: function() {
<div>
<NavBar />
<Locations hash className="Router">
<Location path="/" handler={MainPage} />
<Location path="/help" handler={HelpPage} />
<Location path="/about" handler={AboutPage} />
<NotFound handler={NotFoundPage} />
</Locations>
</div>
}
});
Note the hash parameter in the Locations
tag. When I use the router as such, the links in the <NavBar />
component don't use hashes. However, if I include <NavBar />
in each of my individual components, then the hash linking works as expected. Is there a single place where I can include the <NavBar />
such that it's rendered on all pages displayed by the router?