Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 386 Bytes

Troubleshooting.md

File metadata and controls

20 lines (16 loc) · 386 Bytes

Troubleshooting

How to get previous path?

<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 })
  }
})