Can I update a component's props in React.js?

后端 未结 6 1080
萌比男神i
萌比男神i 2020-11-27 10:15

After starting to work with React.js, it seems like props are intended to be static (passed in from the parent component), while state changes base

6条回答
  •  我在风中等你
    2020-11-27 11:03

    Props can change when a component's parent renders the component again with different properties. I think this is mostly an optimization so that no new component needs to be instantiated.

提交回复
热议问题