I am having trouble passing the values of state from one file to another. I need to do this because when I get to pulling information from the DB, it will need to display more details about these values.
I have a FlatList that when is clicked it sets the value of the item clicked a state value. But it should also navigate to a new screen, while also passing these values to that new screen to be pulled from the DB.
Here is my function that sets the state and calls the function to pass values to the new screen.
_onSectionListPress = (id) {
this.setState({ jobId: id}, () => this._showJobDetail());
};
Here is my function to navigate to the new screen. But this is where I get stuck on how to pass the values.
_showJobDetail = () => {
this.props.navigation.navigate("JobDescriptions", this.state.stakeholderID, this.state.jobId)
};
I'm using react-navigation to try and do this.
Sorry for asking what seems simple in such a complicated way. I'm still pretty new to react-native and I'm not sure how to do this.