passing data from child to parent component - react - via callback function

后端 未结 6 1369
花落未央
花落未央 2020-12-06 07:40

passing data from child to parent component via callback function but somehow it\'s not working. what am I doing wrong here? passing data from child to parent component - re

6条回答
  •  再見小時候
    2020-12-06 08:12

    You can create a method in parent that accepts some data and then sets the received data as parent state. Then pass this method to child as props. Now let the method accept child state as input and then let the method set the received child state as parent state.

提交回复
热议问题