Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it make sense to upgrade to use extends React.Component from React.createClass #18

Closed
skirunman opened this issue Mar 28, 2016 · 3 comments

Comments

@skirunman
Copy link

I'd like to suggest a future upgrade to full ES6 and to class foo extends React.Component from var foo = React.createClass at some time in the future.

"Facebook does suggest the future removal of React.createClass completely in favour of ES6 classes. For now, use what makes sense, they’re both just syntax with different semantics that do the same thing - they’re both classes!"
https://toddmotto.com/react-create-class-versus-component/

@pors
Copy link
Owner

pors commented Mar 28, 2016

The React tutorial still uses React.createClass: https://facebook.github.io/react/docs/tutorial.html

I have a preference for React.createClass. The extends style looks too much like OOP, but Javascript isn't OOP. But that's just me :)

@skirunman
Copy link
Author

I think the trend is definitely to embrace higher order components and the extends React.Component style, especially with ES6. For instance, the new Meteor React Tutorial uses this pattern and Kadira's Mantra also uses it.

With that said, I think it is fine to continue to use React.createClass especially for this type of UI package, and of course, it is your code base so you obviously get to pick the style.

Here is another take on the issue.

I'll close this out for now.

@pors
Copy link
Owner

pors commented Mar 29, 2016

I think that last article is about something else?

Anyway, it indeed seems the class extends style is on the rise. As soon as Facebook starts recommending it we can fix it as well. But for now I want to focus on completing all functionality of Meteoric :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants