How to get FlowRouter params in getMeteorData?

FlowRouter.route('/community/:slug', {
    action() {
        ReactLayout.render(App, { content: <CommunityLanding /> });
    }
});

Example = React.createClass({
    mixins: [ReactMeteorData],
    getMeteorData() {
        return {
            // Get :slug here to subscribe?
        };
    },

    render() {
        return (
          <p>Test</p>
        )
    }
});

How can I get the URL parameters to subscribe within my components?

Looks like I can use FlowRouter.getParam("slug"). Testing…

1 Like

Another option would be to pass the slug as a property from the route.

For example:

FlowRouter.route('/community/:slug', {
    action(params) {
        ReactLayout.render(App, { content: <CommunityLanding slug={params.slug} /> });
    }
});
2 Likes

Cool, thank you :thumbsup: