世博路由器| “找不到页面”

问题描述 投票:0回答:1

我有一个如下的文件结构;

我当前位于 [场地] 屏幕上,想要导航至

offer/[offer]

我已经尝试过了;

router.push({
  pathname: "/offer/",
  params: {
    id: id,
  },
});

router.push({
  pathname: `/offer/${id}`,
  params: {
    id: id,
  },
});

我收到了上述错误。

报价/_布局

  return (
    <Stack.Screen
      name="[offer]"
      options={{
        headerTitle: "",
        presentation: "modal",
        headerRight: () => (
          <TouchableOpacity onPress={() => router.back()}>
            <Icon name="close-line" size={24} color={textColor} />
          </TouchableOpacity>
        ),
      }}
    />
  );

场地/_布局

return (
    <Stack
      screenOptions={{
        headerStyle: {
          backgroundColor: backgroundColor,
        },
        headerTintColor: textColor,
      }}
    >
      <Stack.Screen
        name="[venue]"
        options={{
          headerShown: false,
          headerTransparent: true,
          headerTitle: "",
          headerLeft: () => (
            <TouchableOpacity onPress={() => router.back()}>
              <Icon name="arrow-left-line" size={24} color={textColor} />
            </TouchableOpacity>
          ),
        }}
      />
    </Stack>
  );
react-native expo react-navigation expo-router
1个回答
0
投票

在 React Native 项目中,您通常不会使用 Webpack 作为模块打包器,因为 React Native 使用自己的本机打包系统而不是基于 Web 的打包系统。 Webpack 通常与使用 React 等浏览器技术的 Web 开发相关。

在 React Native 中,JavaScript 模块使用 Metro Bundler 进行捆绑,该模块针对移动应用程序开发的要求和限制进行了优化。因此,像“webpack assetModuleFilename”这样的概念并不直接适用于 React Native 的上下文。

© www.soinside.com 2019 - 2024. All rights reserved.