You can try reducex, it stores data in state through props when you change data in redux store.
Another idea: pass the setState method to the child component.
Parent
class Parent extends Component { updateState (data) { this.setState(data); } render() { <View> <Child updateParentState={this.updateState.bind(this)} /> </View> } }
Child
class Child extends Component { updateParentState(data) { this.props.updateParentState(data); } render() { <View> <Button title="Change" onPress={() => {this.updateParentState({name: 'test'})}} /> </View> } }
source share