在React
如果子组件更新(无论是道具还是状态),将调用父componentWillUpdate
的componentWillUpdate
吗?
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.