-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Description
Re-posting this issue from facebook/react:
facebook/react#2796
https://reactjs.org/docs/react-component.html#componentdidupdate is unclear on when it is called with regards to the render function.
The docs state that it's "Invoked immediately after updating occurs" but it is unclear what is meant with updating in this case: it can refer to either the component as a whole updating (meaning post-render), or it can refer to setState() having been processed (which might mean pre-render).
It would be good to explicitly state when this function fires in its documentation (even if somewhere else on the site this is described in text or graphic form already).
There was a PR for this that was merged at one point: facebook/react#2801
But the current website does not include this change. I believe the language from the above PR is still correct and would be helpful to people since it's more specific than what's there currently.