UNPKG

react-router

Version:

A complete routing library for React.js

21 lines (16 loc) 386 B
# Troubleshooting ### How to get previous path? ```js <Route component={App}> {/* ... other routes */} </Route> const App = React.createClass({ getInitialState() { return { showBackButton: false } }, componentWillReceiveProps(nextProps) { const routeChanged = nextProps.location !== this.props.location this.setState({ showBackButton: routeChanged }) } }) ```