As componentWillReceiveProps is deprecated, How do we migrate the below code?
componentWillReceiveProps (nextProps) {
if (nextProps.reloadData && nextProps.realoadDataId) {
this.props.onChange({target: {id: 'reloadData', value: false}})
this.props.reloadData();
}
if (this.props.dataUpdated) {
this.setState({
sucessMessage: 'Updated Successfully'
})
}
if (nextProps.error) {
this.props.setToast(nextProps.error, true)
}
if (nextProps.downloadDataList && nextProps.downloadDataList.length > 0) {
downloadDataAsExcel(nextProps.downloadDataList);
this.props.onChange({target: {id: 'downloadDataList', value: null}})
}
}
Thanks in advance