How to update parent's state in React?

后端 未结 14 1711
粉色の甜心
粉色の甜心 2020-11-22 08:48

My structure looks as follows:

Component 1  

 - |- Component 2


 - - |- Component 4


 - - -  |- Component 5  

Component 3

Component 3 s

14条回答
  •  半阙折子戏
    2020-11-22 09:47

    Most of the answers given above are for React.Component based designs. If your are using useState in the recent upgrades of React library, then follow this answer

提交回复
热议问题