diff --git a/docs/context.html b/docs/context.html index 7a78998a1b..e7d0aef06d 100644 --- a/docs/context.html +++ b/docs/context.html @@ -193,23 +193,16 @@ You can do this directly in React with the powerful "context" API.
Before you build components with an API similar to this, consider if there are cleaner alternatives. For example, you can pass entire React component as props if you'd like to.
If contextTypes is defined within a component, the following lifecycle methods will receive an additional parameter, the context object:
void componentWillReceiveProps(
- object nextProps, object nextContext
-)
+If contextTypes is defined within a component, the following lifecycle methods will receive an additional parameter, the context object:
-boolean shouldComponentUpdate(
- object nextProps, object nextState, object nextContext
-)
-
-void componentWillUpdate(
- object nextProps, object nextState, object nextContext
-)
-
-void componentDidUpdate(
- object prevProps, object prevState, object prevContext
-)
-constructor(props, context)componentWillReceiveProps(nextProps, nextContext)shouldComponentUpdate(nextProps, nextState, nextContext)componentWillUpdate(nextProps, nextState, nextContext)componentDidUpdate(prevProps, prevState, prevContext)Stateless functional components are also able to reference context if contextTypes is defined as a property of the function. The following code shows a Button component written as a stateless functional component.
const Button = ({children}, context) =>
<button style={{background: context.color}}>