Search code examples
javascriptmeteorreactive-programmingmeteor-blaze

How do you pass arguments to Blaze components programmatically?


The meteor-react tutorial instructs you to create your Meteor login buttons by calling Blaze.render:

this.view = Blaze.render(Template.loginButtons,
  React.findDOMNode(this.refs.container));

The account-ui package documentation says that if you want to align the login dropdown on the right edge of the screen, you should use

{{> loginButtons align="right"}}'

Unfortunately,the documentation of the Blaze.render() function doesn't indicate any parameters that my JavaScript can use to pass the equivalent of align="right".

How can I tell Blaze to render the template with align="right"?


Solution

  • Try using Blaze.renderWithData ?

    this.view = Blaze.renderWithData(Template.loginButtons, {
      align: "right"
    }, React.findDOMNode(this.refs.container));