-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v6][Feature]: Supporting stack navigation for react-native. #7943
Comments
For reference, here's my code. You should be able to drop this into the latest expo with
|
CooCooCaCha
changed the title
[v6][Feature]: Please provide a way to wrap routes in a location context.
[v6][Feature]: Supporting stack navigation for react-native.
Aug 17, 2021
Since this would be resolved by #7117, I'm going to close in favor of that issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the new or updated feature that you are suggesting?
I'm using react-router-native v6 and I'm trying to implement a stack navigation hook. However, I've run into issues because useRoutes doesn't wrap its children in a location context. Because of this, cards lower in the stack will render blank because the current route no longer matches.
Details
The hook looks like this:
If I'm on the home route and I navigate to a post then the post route should appear on top of the home route. If I start to swipe from the edge of the screen then the post route should slide away and reveal the home route again.
Internally this works by storing a list of locations like so:
When the location changes it gets added to the stack. Each item in the stack gets rendered as a
<StackCard />
component:Why should this feature be included?
Stack navigation is important for achieving native look and feel in mobile apps. Supporting this kind of behavior would make react-router even more viable for react-native apps.
The text was updated successfully, but these errors were encountered: