From c64df89ecf9357ae71f566d98947f99a9bdf6f8f Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Fri, 11 Jul 2014 14:26:42 -0700 Subject: [PATCH] Fix up getDefaultProps docs --- docs/docs/ref-03-component-specs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/ref-03-component-specs.md b/docs/docs/ref-03-component-specs.md index e104ac0990..0fbfeb64ea 100644 --- a/docs/docs/ref-03-component-specs.md +++ b/docs/docs/ref-03-component-specs.md @@ -42,9 +42,9 @@ Invoked once before the component is mounted. The return value will be used as t object getDefaultProps() ``` -Invoked once before the component is mounted. Values in the mapping will be set on `this.props` if that prop is not specified by the parent component (i.e. using an `in` check). +Invoked once and cached when the class is created. Values in the mapping will be set on `this.props` if that prop is not specified by the parent component (i.e. using an `in` check). -This method is invoked before `getInitialState` and therefore cannot rely on `this.state` or use `this.setState`. +This method is invoked before any instances are created and thus cannot rely on `this.props`. In addition, be aware that any complex objects returned by `getDefaultProps()` will be shared across instances, not copied. ### propTypes