How to use the listen function from history
Find comprehensive JavaScript history.listen code examples handpicked from public code repositorys.
97 98 99 100 101 102 103 104 105 106
var ref = this.props; var history = ref.history; // Do this here so we can setState when a <Redirect> changes the // location in componentWillMount. This happens e.g. when doing // server rendering using a <StaticRouter>. this.unlisten = history.listen(function () { this$1.setState({ match: this$1.computeMatch(history.location.pathname) }); });
0
0
2
+ 3 other calls in file
history.createBrowserHistory is the most popular function in history (81 examples)