简体   繁体   中英

ReactJS - componentWillUpdate on parent component

React如果子组件更新(无论是道具还是状态),将调用父componentWillUpdatecomponentWillUpdate吗?

Since a component gets its props from its parent, if its props change, then it means by definition that the parent must have rerendered. However, a component that updates its own state does not cause its parent to change in any way, and so does not trigger componentWillUpdate on its parent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM