this.props.history.replace({
state: {
from: 'dashboard'
}
});
this.props.history.goBack();
this.props.location.state
的值在更新undefined
后使用this.props.history.goBack()
时为this.props.location.state
。但是
this.props.history.push({
pathname: '/',
state: {
from: 'dashboard'
}
});
工作并保留this.props.location.state
的值。
知道如何更新this.props.location.state
然后使用this.props.history.goBack
吗?