react-router-component icon indicating copy to clipboard operation
react-router-component copied to clipboard

docs don't make it clear how to navigate programatically

Open mgenev opened this issue 8 years ago • 1 comments

It says to vaguely to pass a ref, but a ref of what? What object has the navigate method...

mgenev avatar Aug 07 '17 04:08 mgenev

<Locations ref={x => this.router = x}>...</Locations>

else where:

this.router.navigate('/path/to/route', {replace: true}); //the second arg is optional. the replace key will signal the use of replaceState or pushState (default)

jsg2021 avatar Dec 08 '17 19:12 jsg2021