-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
some codes needs enhancement! #1337
Comments
one more ! // bad
React.createClass({
_onClickSubmit() {
// do stuff
},
// other stuff
});
// not too good
class extends React.Component {
onClickSubmit() {
// do stuff
}
// other stuff
} it solud be like this, // bad
React.createClass({
_onClickSubmit() {
// do stuff
},
// other stuff
});
// good
React.createClass({
onClickSubmit() {
// do stuff
},
// other stuff
}); or this. // bad
class extends React.Component {
_onClickSubmit() {
// do stuff
},
// other stuff
};
// very good & ES6
class extends React.Component {
onClickSubmit() {
// do stuff
}
// other stuff
} |
I'm confused - in your latter example, you seem to be referring to the "Do not use underscore prefix for internal methods of a React component." section of https://github.com/airbnb/javascript/tree/master/react - where I do see what you mean in the first example; please feel free to submit a PR to fix that. (I've also updated your comments to remove the unnecessary markdown headings ( |
what's I mean is that both demos should have the same condition(e.g parameters) for compare! |
old
new
The text was updated successfully, but these errors were encountered: