我已创建并通过使用create-react-native-app新反应本机应用程序。 我结束了一个在博览会上运行良好的应用程序。 然后,我想从react-navigation中添加堆栈StackNavigator 我已经从reactnavigation.org流出了指南,并且我在应用程序目录中做了npm install --save react-navigation
。 唯一不同的是我使用create-react-native-app AwesomeProject
而不是react-native init SimpleApp
。StackNavigator在反应本机应用程序
,我面临的问题是,当我删除默认的出口来回我的课,我得到错误检查AwakeInDevApp:
代码App.js的:
import React from 'react';
import { StyleSheet, Text, View, AppRegistry, Button } from 'react-native';
import { StackNavigator } from 'react-navigation';
export default class App extends React.Component {
static navigationOptions = {
title: 'Welcome',
};
render() {
return (
<View>
<Text>Hello, Chat App!</Text>
<Button
onPress={() => navigate('Chat')}
title="Chat with Lucy"
/>
</View>
);
}
}
class ChatScreen extends React.Component {
static navigationOptions = {
title: 'Chat with Lucy',
};
render() {
return (
<View>
<Text>Chat with Lucy</Text>
</View>
);
}
}
const SimpleApp = StackNavigator({
Home: { screen: App },
Chat: { screen: ChatScreen },
});
AppRegistry.registerComponent('SimpleApp',() => SimpleApp);
我没有看到法'AwakeInDevApp'在你的项目,你可以用你的fulll代码项目中再次阐述您的问题? – muhammadaa