Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"?

like image 964
Thom Boyer Avatar asked Aug 01 '15 17:08

Thom Boyer


1 Answers

Try using Blaze.renderWithData ?

this.view = Blaze.renderWithData(Template.loginButtons, {
  align: "right"
}, React.findDOMNode(this.refs.container));
like image 57
saimeunt Avatar answered Sep 23 '22 02:09

saimeunt