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:
- underscore
- templating
- react-runtime
Related links
- Meteor Forum: Smoothly feature up your Blaze Apps with React Components
- Read the docs: React in Meteor
- 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.