I would like to setState, in my case, feedbackLogId
, which is required to called a function that will GET the details of feedback according to the feedbackLog
Try to use getDerivedStateFromProps
static getDerivedStateFromProps = (props, state) => {
console.log('props',props.navigation)
const feedbackLogId = props.navigation.getParam('value', 'nothing');
if(feedbackLogId){
this.getPendingDetails(feedbackLogId);
}
}
In your constructor
this.getPendingDetails = getPendingDetails.bind(this)
to
this.getPendingDetails = this.getPendingDetails.bind(this)