You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 20, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on May 20, 2021. It is now read-only.
At the details screen user can click on some other recommended movie to see the details of it. So, for example, I need to go from /details/123 to /details/321.
Since I'm building on mobile and web at the same time, I'm trying to reuse as much code as possible. That's why I tried to use navigation.push, but it doesn't exist.
navigation.navigate works in other cases, but here it doesn't re-render the page - imdbId in the url changes, but screen doesn't. I've also tried passing an unique key with no success. Dispatching a push action also doesn't work.
Should I just check if the url changed and rerender the page, or is there a better way?
Activity
satya164 commentedon Mar 2, 2019
Can you provide some code please?
kasinskas commentedon Mar 2, 2019
Sure. I have such route:
const switchNavigator = createSwitchNavigator( { Details: { screen: DetailsScreen, path: 'details/:imdbId' }, ); const AppContainer = createBrowserApp(switchNavigator);At the details screen user can click on some other recommended movie to see the details of it. So, for example, I need to go from /details/123 to /details/321.
navigation.navigate('Details', { title: movie.Title, imdbId: movie.imdbID, })Since I'm building on mobile and web at the same time, I'm trying to reuse as much code as possible. That's why I tried to use navigation.push, but it doesn't exist.
navigation.navigate works in other cases, but here it doesn't re-render the page - imdbId in the url changes, but screen doesn't. I've also tried passing an unique key with no success. Dispatching a push action also doesn't work.
Should I just check if the url changed and rerender the page, or is there a better way?