Closed payner35 closed 8 years ago
so figured out you can do it this way...
import Event from '../containers/event';
import TopNav from '../containers/topNav';
export const initRoutes = (context, actions) => {
const MainLayoutCtx = injectDeps(context, actions)(MainLayout);
// Move these as a module and call this from a main file
FlowRouter.route('/:region/events/:slug', {
name: 'events.single',
action({region, slug}) {
mount(MainLayoutCtx, {
nav: () => (<TopNav />),
content: () => (<Event someRegion={region} slug={slug} />)
});
}
});
and then adding to the Layout
<header>
{nav()}
</header>
<div>
{content()}
</div>
I have a simple container to manage the state of my Nav bar.
composer manages the state topNavDepsMapper exposes (injects) the functions
this is my component
but for some reason my props is empty in the TopNav Component... What am i missing here?