React有一个优化逻辑就是走Bailout,满足以下4个条件就会走Bailout,不会默认re-render
1.newProps === oldProps
2.newType === oldType
3.context 没有更新
4.fiber上没有更新,或优先级低
评论