Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.13 KB

README.md

File metadata and controls

51 lines (38 loc) · 1.13 KB
- NOTE: This package is not maintained anymore.
- If you want to help, please reach out to [email protected]

Meteor Blaze To React

Turn any Blaze template into a React component.

Installation

meteor add gwendall:blaze-to-react

Note:

  • For Meteor 1.2, use the latest 0.x.x release. It relies on the react package.

  • For Meteor 1.3+, use the latest 1.x.x release. It relies on react from npm. <BlazeToReact> is still provided as a global for convenience. But if you want, you can import BlazeToReact from 'meteor/gwendall:blaze-to-react';

How it works

Use the <BlazeToReact /> component. Pass it the blazeTemplate parameter with the name of your Blaze template, along with any parameter you want to pass to this Blaze template.

Example

<template name="fruitsList">
  <ul>
    {{#each items}}
      <li>{{this}}</li>
    {{/each}}
  </ul>
</template>
var items = ['peers', 'bananas', 'apples'];
Meteor.startup(function() {
  React.render(<BlazeToReact blazeTemplate="fruitsList" items={items}/>, document.body);
});