Reactjs withNavigation只能用于本机图纸的视图层次结构
我用的是本地纸。现在,我尝试返回按钮与导航选项卡,我收到错误 不变冲突:withNavigation只能用于导航器的视图层次结构。包装的组件无法从道具或上下文访问导航 HomeScreen.js 我想, 您正在使用react native paper,而withNavigation属于其他用户 图书馆反应导航Reactjs withNavigation只能用于本机图纸的视图层次结构,reactjs,react-native,redux,react-redux,Reactjs,React Native,Redux,React Redux,我用的是本地纸。现在,我尝试返回按钮与导航选项卡,我收到错误 不变冲突:withNavigation只能用于导航器的视图层次结构。包装的组件无法从道具或上下文访问导航 HomeScreen.js 我想, 您正在使用react native paper,而withNavigation属于其他用户 图书馆反应导航 ,谢谢您能告诉我您在哪里定义导航器吗?我使用此导航您使用的是react本机论文,withNavigation属于另一个库react navigation谢谢,我已更改为react navi
,谢谢您能告诉我您在哪里定义导航器吗?我使用此导航您使用的是react本机论文,withNavigation属于另一个库react navigation谢谢,我已更改为react navigation
import React from 'react'
import { View, StatusBar, Button} from 'react-native'
import { Subheading, withTheme } from 'react-native-paper'
import { withNavigation } from 'react-navigation';
import styles from '../assets/css/Style';
class HomePageView extends React.Component {
render() {
return (
<View style={[styles.container]}>
<StatusBar hidden />
<View style={styles.row}>
<Subheading>Home Screen</Subheading>
</View>
<Button
title="Back"
onPress={() => {
this.props.navigation.goBack();
}}
/>
</View>
);
}
}
function HomeScreen({ theme }) {
const { colors } = theme
return (<HomePageView style={[styles.container, { backgroundColor: colors.surface }]} />)
}
export default withNavigation(withTheme(HomeScreen));