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:
useNavigationuseRouter<Tabs initialRouteName="my-child" backBehavior="history"
try adding backBehavior to "history" in your Tabs component.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With