Visitar URL original
export default should not be inline with the class declaration · SourceCode/javascript@efe7507 · GitHub
Skip to content

Commit efe7507

Browse files
committed
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.
1 parent 89d1e07 commit efe7507

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎react/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
text: 'Hello World',
275275
};
276276
277-
export default class Link extends Component {
277+
class Link extends Component {
278278
static methodsAreOk() {
279279
return true;
280280
}
@@ -286,6 +286,8 @@
286286
287287
Link.propTypes = propTypes;
288288
Link.defaultProps = defaultProps;
289+
290+
export default Link;
289291
```
290292
291293
- Ordering for React.createClass:

0 commit comments

Comments
 (0)