You can pass down state using the <Link>
component, in this case a pathname:
<Link to={{pathname: '/nextpath', state: { prevPath: location.pathname }}}>Example Link</Link>
You can then access prevPath
from this.props.location.state
in the next component
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…