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 小時 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 75/100
mksglu/context-mode#1200 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
neondatabase/website#5944 ·
-
module: core
難度 2/5 1-3 小時 新手友好度 75/100
bigbluebutton/bigbluebutton#25849 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
jaegertracing/jaeger-ui#4506 ·