Render error: Couldn't find a navigation context
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, node.js, react-native
- 领域
- mobile
调研方向
可复现的入口点是 issue 中展示的、包含 NavigationContainer、Tab.Navigator、Feed 和 StreamApp 的最小 App。在 Android 上使用所述的 Expo 和 Node 版本运行它,然后跟踪 FlatFeed 及其子组件如何在标签导航器中使用导航上下文。完成的标准是 feed 在该导航设置中渲染且不出现报告的错误。
由索引模型根据 Issue 内容生成。
描述
I get this error:
"Render Error: Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'?"
I noticed that this issue appears whenever a Stream Flatfeed is inside a navigation container. When the feed is on its own (not part of any stack/tab navigation), it renders correctly. I am testing on Android using Node v16.13.1 and Expo v44.
Any tips on this?
I was able to reproduce this issue on a smaller app:
import React, { Fragment } from 'react';
import { Text, View } from 'react-native';
import SafeAreaView from 'react-native-safe-area-view';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { StreamApp, FlatFeed, Activity, LikeButton, StatusUpdateForm, ReactionIconBar} from 'expo-activity-feed';
const Tab = createMaterialTopTabNavigator();
function Feed() {
return (
<View style={{ flex: 1 }}>
<StreamApp
apiKey={apiKey}
appId={appId}
token={token}>
<FlatFeed
Activity={props => (
<Fragment>
<Activity
{...props}
Footer={
<ReactionIconBar>
<LikeButton {...props} />
</ReactionIconBar>
}
/>
</Fragment>)} notify/>
<StatusUpdateForm feedGroup='timeline' />
</StreamApp>
</View>
)
}
function Screen2() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Screen 2</Text>
</View>
);
}
export default App = () => {
return (
<SafeAreaProvider>
<SafeAreaView style={{ flex: 1 }}>
<NavigationContainer>
<Tab.Navigator
screenOptions={{
tabBarLabelStyle: { fontSize: 12 },
tabBarItemStyle: { width: 100 },
}}>
<Tab.Screen name="Feed" component={ Feed } />
<Tab.Screen name="Screen2" component={ Screen2 } />
</Tab.Navigator>
</NavigationContainer>
</SafeAreaView>
</SafeAreaProvider>
);
};
- 主要语言
- JavaScript
- 星标
- 339
- 派生
- 193
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GetStream/react-native-example 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 18/100
GetStream/react-native-example#45 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
GetStream/react-native-example#39 · 2 条评论 ·
-
GetStream/react-native-example#38 · 11 条评论 · 10 个 reaction · 已指派 1 人 ·
-
难度 3/5 1-2 天 新手友好度 25/100
GetStream/react-native-example#35 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
查看 GetStream/react-native-example 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
palladius/rails8-app-on-gcp#145 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
难度 2/5 1-3 小时 新手友好度 65/100
web-platform-tests/interop#1455 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
corsairdev/corsair#1764 ·
-
难度 2/5 1-3 小时 新手友好度 75/100