Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我的故事书中有两个组件RadioButton和RadioButtonWithIcons. 在两个组件的初始渲染中,我componentDidMount开始做一些工作。然后ComponentDidUpdate触发组件中的任何更改。
RadioButton
RadioButtonWithIcons
componentDidMount
ComponentDidUpdate
但是,如果我从侧面板切换 RadioButton到RadioButtonWithIcons,它会立即触发RadioButtonWithIcons' ComponentDidUpdate... 为什么会发生这种情况?