mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-13 20:27:56 -05:00
export default should not be inline with the class declaration
When there are static variables like `propTypes` and `defaultProps`, we shouldn't export them until we have actually set them onto the `Component`. This may change if the current ES7 proposal for static class properties gets accepts, and we update to support it.
This commit is contained in:
@@ -274,7 +274,7 @@
|
||||
text: 'Hello World',
|
||||
};
|
||||
|
||||
export default class Link extends Component {
|
||||
class Link extends Component {
|
||||
static methodsAreOk() {
|
||||
return true;
|
||||
}
|
||||
@@ -286,6 +286,8 @@
|
||||
|
||||
Link.propTypes = propTypes;
|
||||
Link.defaultProps = defaultProps;
|
||||
|
||||
export default Link;
|
||||
```
|
||||
|
||||
- Ordering for React.createClass:
|
||||
|
||||
Reference in New Issue
Block a user