When navigating between /listing/1 and /listing/2, expo-router may replace the current route in the history stack instead of adding a new entry.
This happens because the route paths only differ by a dynamic id, which some configurations may treat as a single screen.
so When router.back() is called, it looks at the history stack. If the navigation history only has /home or /listing/2 (replacing /listing/1), it will go back to /home.
To avoid it u can use router.push(/whatever) to the stack. instead of router.replace(/whatever).
const navigateToListing = (id) => {
const router = useRouter();
router.push(`/listing/${id}`);
};