inferno
inferno copied to clipboard
inferno-router: catch Hash history cannot PUSH the same path;
Issue Template
Is there a way to catch this and do something?
Inferno Metadata
macOS Safari / Chrome / Firefox / [email protected]
Hi can you give concerete example what you are trying to do please
@Havunen when the user clicks on a <Link to="/someurl">Go</Link>
and he's already on that URL, a warning will show on the console. What I want to do is do state changes on the parent
of the Route
component.
class App extends Component {
state = {
// some state
}
handler = () => {
// handle user already on that path.
}
render = () => (
<Parent>
<HashRouter>
<Route onComponentAlreadyHere={this.handler} path="someurl" component={Page} />
</HashRouter>
</Parent>
);
}
I'm not very familiar with the Router code base, maybe @nightwolfz @LukeSheard knows better. Meanwhile you can try to check this out yourself?