Beginner Questions
merlinstardust opened this issue · comments
Why is React
imported in some files but not used?
Why does core/components/newpost.jsx
use React.createClass
but core/components/postlist
and core/components/post
do not?
In the Meteor tutorial, the App gets rendered with React.render(<App />, document.getElementById("render-target"));
, but in Mantra, this code is nowhere. So I would assume it gets replaced by app.init()
. But in mantra-core
, there is no React.render
. So how is it being rendered?
In core/components/postlist
we use React's stateless components. With that, even though we don't use React on the code, it'll add when converting this code to normal JS.
That's why we need it.
Rendering
It's rendered in routes. See: https://github.com/mantrajs/mantra-sample-blog-app/blob/master/client/modules/core/routes.jsx
(We use react-mounter for that)
Thanks @arunoda!