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
The gadicc:blaze-react-component dependency is automatically included.
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>
How It Works
- When used as
{{#React}}...{{/React}}, the package captures the BlazecontentBlock - It registers the content block as a dynamic template with a unique name
- It uses
gadicc:blaze-react-componentto render the Blaze content as a React child - The dynamic template is cleaned up when the component is destroyed
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 - 19gadicc:blaze-react-component(included automatically)
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.