react-enlightenment icon indicating copy to clipboard operation
react-enlightenment copied to clipboard

componentWillUpdate() comes before render()

Open ZacharyRSmith opened this issue 9 years ago • 1 comments

6.7 says

Updating Phase follows this order:
componentWillReceiveProps()
shouldComponentUpdate()
render()
Children Life cycle methods
componentWillUpdate()

but the docs say "Invoked immediately before rendering when new props or state are being received. This method is not called for the initial render."

ZacharyRSmith avatar Sep 19 '16 16:09 ZacharyRSmith

Yeah, there is a bug there. The correct order is:

componentWillReceiveProps()
shouldComponentUpdate()
componentWillUpdate()
render()
Children Life cycle methods
componentDidUpdate()

I have the fix in this PR: https://github.com/FrontendMasters/react-enlightenment/pull/38

glrodasz avatar Mar 22 '17 04:03 glrodasz