From efe7507e65a6ef95f04ffa33297ae397e8b63399 Mon Sep 17 00:00:00 2001 From: Maja Wichrowska Date: Tue, 20 Oct 2015 17:31:01 -0700 Subject: [PATCH] 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. --- react/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react/README.md b/react/README.md index dd5592f4..6b0a8e13 100644 --- a/react/README.md +++ b/react/README.md @@ -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: