4commerce:blaze-as-react

v1.0.1Published 10 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

4commerce:blaze-as-react

This meteorjs package allows you to use Blaze templates as and inside React components.

You can add this package to your meteor app like any other package from atmosphere

$ meteor add 4commerce:blaze-as-react

Usage

This package registers the function Template.AsReactComponent() and the property React.BlazeView.

foo.html:

<template name="foo">
  <div>
    <p>Hello world!: {{bar}}
  </div>
</template>

about.jsx:

var pageAbout = React.createClass({
  render() {
    return (
      <div>
        <React.BlazeView template="foo" bar="Send from React ..." />
      </div>
    );
  }
});

about.jsx:

var Foo = Template.AsReactComponent('foo');

var pageAbout = React.createClass({
  render() {
    return (
      <div>
        <Foo bar="Send from React ..." />
      </div>
    );
  }
});

Package dependencies

When you add this package, follwing dependencies will load:

  1. underscore
  2. templating
  3. react-runtime
  1. Meteor Forum: Smoothly feature up your Blaze Apps with React Components
  2. Read the docs: React in Meteor
  3. Meteor on github: React packages

Issues & help

In case of support or error please report your issue request. The issue tracker is available at: https://github.com/4commerce-technologies-AG/meteor-package-blaze-as-react/issues

Author & Credits

Author: Tom Freudenberg, 4commerce technologies AG

Copyright (c) 2015 Tom Freudenberg, 4commerce technologies AG, released under the MIT license

I found a number of ressources on the internet doing something similar but not completely. So I took all here together in this new package. Thanks to all unlisted authors for their inspiration.