Issue
In my _layout.tsx, I have a Tab navigator with all my different routes declared. Sometimes I want to redirect to a form, by using router.push("foo"), and then on submission, I call router.back().
Instead of redirecting me to the site that I was on before, it goes to the first tab in the Tab bar.
Note: I am using the router that I import like so
import { router } from "expo-router";
Things I have tried:
- Using
useNavigation - Using
useRouter
Solution
<Tabs initialRouteName="my-child" backBehavior="history"
try adding backBehavior to "history" in your Tabs component.
Answered By - cWW
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.