最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

reactjs - I created a layout using expo-router but the back gesture works buggy - Stack Overflow

programmeradmin1浏览0评论

When I'm on the home page and I go to the profile and then to the post page and then I try to go back 2 times with a quick gesture, I get this kind of situation. When I go from the post page to the profile and then to the home page, it goes back to the profile and then back to the home page. I can understand it can be a bit confusing :D

Video

This is my layout

import { Stack } from "expo-router";

const HomeLayout = () => {
  return (
    <Stack
      screenOptions={{
        headerShown: false,
        fullScreenGestureEnabled: true,
        gestureEnabled: true,
      }}
    >
      <Stack.Screen
        name="index"
        options={{
          title: "Home",
        }}
      />
      <Stack.Screen
        name="[postID]"
        options={{
          title: "Post",
        }}
      />
      <Stack.Screen
        name="profile/[userID]"
        options={{
          title: "Profile",
        }}
      />
    </Stack>
  );
};

export default HomeLayout;

I also tried setting gestureEnabled: false when leaving that page with useFocusEffect, but this method did not work either

发布评论

评论列表(0)

  1. 暂无评论