Closed podo closed 9 years ago
Without using Meteor you would use require and export with something like Browserify. Maybe Meteor will bundle/build if the files were renamed to .js On Mar 29, 2015 11:55 AM, "Giedrius Jaloveckas" notifications@github.com wrote:
I’m having difficulties figuring out how to separate react components into jsx files and loading one of them as a child into another.
var PostsList = ReactMeteor.createClass({ ... render: function() { var children = this.state.posts.map(function(post) { return
}) return ( <div className="posts"> { children } </div> );
} }); var Post = ReactMeteor.createClass({ render: function() { return (
{this.props.title});
} });
This seems to work as a single file, but I’m thinking if it’s possible to load have Post as a separate jsx template.
— Reply to this email directly or view it on GitHub https://github.com/reactjs/react-meteor/issues/51.
Apparently, removing var
from all templates fixed this, because adding var limits scope of the variable only to the same file.
Thanks, @podo
I’m having difficulties figuring out how to separate react components into
jsx
files and loading one of them as a child into another.This seems to work as a single file, but I’m thinking if it’s possible to load have
Post
as a separatejsx
template, because I’m getting this error: