Skip to content Skip to sidebar Skip to footer

Unable To Call Or Update State Of Another Component React Native

I am unable to fire a method on the parent component when I click a button from a child component. This is my code: constructor(props) { super(props); this.state

Solution 1:

If you need to update the parent state, you will need to create a function in the parent that updates its state and pass that function to the child as a prop. Then you can update the parent state by calling this.props.whateveryourmethodis


Post a Comment for "Unable To Call Or Update State Of Another Component React Native"