chatra:react-template-helper
Enhanced React Template Helper for Meteor Blaze with block component support.
Based on meteor/react-packages react-template-helper with added support for block components that can render Blaze content as React children.
Installation
meteor add chatra:react-template-helper
Usage
Inclusion Syntax (Original Behavior)
Block Syntax (Enhanced)
Renders Blaze content as React children:
<p>This Blaze content becomes React children!</p>
This is equivalent to:
1<MyAccordion title="Settings"> 2 <p>This Blaze content becomes React children!</p> 3 <SomeOtherBlazeTemplate /> 4</MyAccordion>
Block syntax works correctly inside {{#each}} loops — each iteration preserves its own Blaze scope (variables, data context, etc.).
How It Works
- When used as
{{#React}}...{{/React}}, the package captures the BlazecontentBlockandparentView - A
BlazeContentBlockReact component renders the content block viaBlaze.render()with the original parent view - This preserves the full Blaze scope chain (
{{#each}}variables,{{#let}}bindings, data contexts) - The Blaze view is cleaned up when the React component unmounts
Migration from react-template-helper
Replace in .meteor/packages:
- react-template-helper + chatra:react-template-helper
All existing {{> React ...}} usage will continue to work unchanged.
Dependencies
react15.3 - 19react-dom15.3 - 19
Publishing
To publish a new version to Atmosphere:
cd react-template-helper meteor publish
Make sure you're logged in with meteor login and have publish rights for the chatra organization.