(props)
| 49 | */ |
| 50 | class Router extends Component { |
| 51 | constructor(props) { |
| 52 | super(props); |
| 53 | this.state = { location: route1 }; |
| 54 | toggleLocation = () => { |
| 55 | const oldLocation = this.state.location; |
| 56 | const newLocation = oldLocation === route1 ? route2 : route1; |
| 57 | // console.log('Toggling location', oldLocation, '->', newLocation); |
| 58 | this.setState({ location: newLocation }); |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | render() { |
| 63 | // console.log('Rendering Router', { location: this.state.location }); |