Feature request: Programatic navigation
See original GitHub issueI’ve ended up using this action to navigate between pages:
effects: {
navigate: (action, state, send) => {
send('app:location', {location: action.location});
window.history.pushState({}, null, action.location);
}
}
It’d be nice if there was an officially recommended way to do it. (This or something else.)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Feature Requests | React Navigation - Canny
One way to solve this is have a way to tell react-native-screens to "hang on to" the currently active ViewController (store the pointer...
Read more >Feature request package.json & programmatic usage · Issue #11 ...
First of all this seems like an amazing module! Amazing job! It would be pretty awesome if the vscode plugin could show approx....
Read more >Interact programmatically with the Navigation component
The Navigation component provides ways to programmatically create and interact with certain navigation elements.
Read more >Programmatic navigation using React Router - Sentry
In React Router v6, you can use the useNavigate hook. It returns a function that lets you navigate programmatically. import { useNavigate }...
Read more >Modern client-side routing: the Navigation API
First is programmatic navigation, where navigation is caused by a method call inside your client-side code. You can call navigation.navigate('/another_page') ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @josephg, we were just talking about this (see #21). It looks like the best way may be to use the native DOM API (
window.location.hash = 'foo'
). For browser history, I can’t member if it’swindow.location.url
orpushState
as you have above. But the point is, adjusting those triggers the internal router. And the nice thing about this is that you don’t have to memorize a new framework-specific way to change the page/URL. How’s that sound?Yup I think this should all work now in
v4
- closing! 😁