I'm trying to learn meteor-react, and I have a question about using FlowRouter to insert content into HTML template pages.
Let's assume everything is imported correctly, this is the relevant code:
routes.jsx
FlowRouter.route('/post/:postId', {
name: 'posts.single',
action({postId}) {
mount(MainLayoutCtx, {
content: () => (<Post postId={postId}/>)
});
}
});
index.jsx - where MainLayoutCtx is pointing to
const Layout = ({content = () => null }) => (
//code here
);
In index.jsx, {content = () => null}. Doesn't this mean content is an object literal that has no parameters and outputs null?
But when content is being passed in routes.jsx, it's () => (/Post postId={postId}/>) So isn't that content outputting Post with postId passed in as a prop?
How does this match with what index.jsx is expecting?