Closed andersr closed 8 years ago
Oh, now I see, this is an example of a stateless React component, as you do explain in your comments. All clear now, pls ignore :}
@andersr You got it! I tried to cover everything possible :)
BTW, for anyone else stumbling on this issue, the link to the explanation is here:
https://github.com/ffxsam/ffx-meteor-react-boilerplate/blob/example/client/layouts/MainLayout.jsx
Hi - I'm really finding this boilerplate repo to be a great learning tool. All your detailed comments are super helpful! One detail, however, has me completely stumped.
Previously, when creating a React component, I would do something like this:
However, in your repo, you are creating a component as follows:
How is this being defined as a React component? It seems as if all that is happening here is that a generic
MyComponent
variable or module is being defined. I would expect eitherFoo = React.createClass
orclass Foo extends React.Component
I've tried googling around, but all the examples I've found use either the create or extend syntax.
If you could update your comments or provide an explanation (or just link to a good explanation), it would be most appreciated!
Thanks so much!