mirror of
https://github.com/airbnb/javascript.git
synced 2026-04-25 03:00:19 -04:00
Remove space from jsx literal and add space to function definition
According to PR comments.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
const Listing = React.createClass({
|
||||
// ...
|
||||
render: function() {
|
||||
return <div>{ this.state.hello }</div>;
|
||||
return <div>{this.state.hello}</div>;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
class Listing extends React.Component {
|
||||
// ...
|
||||
render() {
|
||||
return <div>{ this.state.hello }</div>;
|
||||
return <div>{this.state.hello}</div>;
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -56,13 +56,13 @@
|
||||
// bad
|
||||
class Listing extends React.Component {
|
||||
render() {
|
||||
return <div>{ this.props.hello }</div>;
|
||||
return <div>{this.props.hello}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
// good
|
||||
function Listing({ hello }){
|
||||
return <div>{ hello }</div>;
|
||||
function Listing ({ hello }) {
|
||||
return <div>{hello}</div>;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user