Reactjs 当且仅当调用render时是否调用componentDidUpdate?

Reactjs 当且仅当调用render时是否调用componentDidUpdate?,reactjs,Reactjs,React组件具有render方法,并且可以具有componentdiddupdate方法。我的问题是:componentdiddupdate是否在每次渲染后都会被调用,是否有任何时候componentdiddupdate会被调用,但render不会被调用?componentdiddupdate总是在渲染后被调用。因此,如果使用shouldComponentUpdate阻止渲染,例如,diddupdate将永远不会被调用 是否有调用componentDidUpdate但不调用render的情况?

React组件具有
render
方法,并且可以具有
componentdiddupdate
方法。我的问题是:
componentdiddupdate
是否在每次渲染后都会被调用,是否有任何时候
componentdiddupdate
会被调用,但
render
不会被调用?

componentdiddupdate
总是在
渲染后被调用。因此,如果使用
shouldComponentUpdate
阻止渲染,例如,
diddupdate
将永远不会被调用

是否有调用componentDidUpdate但不调用render的情况?


否,
componentdiddupdate
取决于要调用的
render
。但是oposite可能发生,
componentdiddupdate
componentdiddupdate
总是在
render
之后调用。因此,如果使用
shouldComponentUpdate
阻止渲染,例如,
diddupdate
将永远不会被调用

是否有调用componentDidUpdate但不调用render的情况?

否,
componentdiddupdate
取决于要调用的
render
。但是oposite可能发生,
componentdiddupdate