From 8712f6daa08dfa1246f8619f446ec04dde93f553 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sun, 23 Oct 2016 14:35:23 +0100 Subject: [PATCH] Link to lifecycle methods from Context doc (#8062) --- docs/context.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/context.md b/docs/context.md index 499b3416..3ae11fe8 100644 --- a/docs/context.md +++ b/docs/context.md @@ -136,25 +136,13 @@ Before you build components with an API similar to this, consider if there are c ## Referencing Context in Lifecycle Methods -If `contextTypes` is defined within a component, the following lifecycle methods will receive an additional parameter, the `context` object: +If `contextTypes` is defined within a component, the following [lifecycle methods](/react/docs/react-component.html#the-component-lifecycle) will receive an additional parameter, the `context` object: -```javascript -void componentWillReceiveProps( - object nextProps, object nextContext -) - -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)`](/react/docs/react-component.html#constructor) +- [`componentWillReceiveProps(nextProps, nextContext)`](/react/docs/react-component.html#componentwillreceiveprops) +- [`shouldComponentUpdate(nextProps, nextState, nextContext)`](/react/docs/react-component.html#shouldcomponentupdate) +- [`componentWillUpdate(nextProps, nextState, nextContext)`](/react/docs/react-component.html#componentwillupdate) +- [`componentDidUpdate(prevProps, prevState, prevContext)`](/react/docs/react-component.html#componentdidupdate) ## Referencing Context in Stateless Functional Components