diff --git a/docs/docs/07-working-with-the-browser.md b/docs/docs/07-working-with-the-browser.md index 538b32f37d948..5900e19263e74 100644 --- a/docs/docs/07-working-with-the-browser.md +++ b/docs/docs/07-working-with-the-browser.md @@ -87,13 +87,13 @@ React provides lifecycle methods that you can specify to hook into this process. * `componentWillReceiveProps(object nextProps)` is invoked when a mounted component receives new props. This method should be used to compare `this.props` and `nextProps` to perform state transitions using `this.setState()`. * `shouldComponentUpdate(object nextProps, object nextState): boolean` is invoked when a component decides whether any changes warrant an update to the DOM. Implement this as an optimization to compare `this.props` with `nextProps` and `this.state` with `nextState` and return false if React should skip updating. -* `componentWillUpdate(object nextProps, object nextState)` is invoked immediately before updating occurs. You cannot call `this.setState()` here. +* `componentWillUpdate(object nextProps, object nextState, DOMElement rootNode)` is invoked immediately before updating occurs. You cannot call `this.setState()` here. * `componentDidUpdate(object prevProps, object prevState, DOMElement rootNode)` is invoked immediately after updating occurs. ### Unmounting -* `componentWillUnmount()` is invoked immediately before a component is unmounted and destroyed. Cleanup should go here. +* `componentWillUnmount(DOMElement rootNode)` is invoked immediately before a component is unmounted and destroyed. Cleanup should go here. ### Mounted Methods diff --git a/docs/docs/09-reference.md b/docs/docs/09-reference.md index 96f3a0063a57e..a7b86a5fd1cdd 100644 --- a/docs/docs/09-reference.md +++ b/docs/docs/09-reference.md @@ -186,13 +186,13 @@ Normally you should try to avoid all uses of `forceUpdate()` and only read from ```javascript object getInitialState() componentWillMount() -componentDidMount(DOMElement domNode) +componentDidMount(DOMElement rootNode) componentWillReceiveProps(object nextProps) boolean shouldComponentUpdate(object nextProps, object nextState) -componentWillUpdate(object nextProps, object nextState) +componentWillUpdate(object nextProps, object nextState, DOMElement rootNode) ReactComponent render() -componentDidUpdate(object prevProps, object prevState, DOMElement domNode) -componentWillUnmount() +componentDidUpdate(object prevProps, object prevState, DOMElement rootNode) +componentWillUnmount(DOMElement rootNode) ``` See the [working with the browser](./working-with-the-browser.html) documentation for more details on these lifecycle methods. diff --git a/src/core/ReactCompositeComponent.js b/src/core/ReactCompositeComponent.js index 8a4846db58f23..f9a6fde023829 100644 --- a/src/core/ReactCompositeComponent.js +++ b/src/core/ReactCompositeComponent.js @@ -524,7 +524,7 @@ var ReactCompositeComponentMixin = { unmountComponent: function() { this._compositeLifeCycleState = CompositeLifeCycle.UNMOUNTING; if (this.componentWillUnmount) { - this.componentWillUnmount(); + this.componentWillUnmount(this.getDOMNode()); } this._compositeLifeCycleState = null; @@ -686,7 +686,7 @@ var ReactCompositeComponentMixin = { var prevState = this.state; if (this.componentWillUpdate) { - this.componentWillUpdate(nextProps, nextState, transaction); + this.componentWillUpdate(nextProps, nextState, this.getDOMNode()); } this.props = nextProps;