Call child function from parent component in React Native

前端 未结 5 457
梦毁少年i
梦毁少年i 2020-12-03 09:47

I\'m developing my first React Native app. What I\'m trying to achieve is to execute a child function from the parent component, this is the situation:

Child

5条回答
  •  难免孤独
    2020-12-03 10:08

    You can add a ref to the child component:

    
    

    Then call the method on the child like this:

提交回复
热议问题