How do you pass arguments to Blaze components programmatically?
Asked Answered
M

1

8

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

Mountbatten answered 1/8, 2015 at 17:21 Comment(0)
C
9

Try using Blaze.renderWithData ?

this.view = Blaze.renderWithData(Template.loginButtons, {
  align: "right"
}, React.findDOMNode(this.refs.container));
Cestus answered 1/8, 2015 at 17:25 Comment(1)
Huh. I saw Blaze.renderWithData(), but the description of that argument ("The data context to use") did not sound like it was talking about what I needed. Thanks!Mountbatten

© 2022 - 2024 — McMap. All rights reserved.