This function needs to match the `react-router` equivalent. See https://github.com/idom-team/idom-router/issues/2 for more details.