var React = require('react-native');
var Index = require('./iospage/Index');
var {
NavigatorIOS,
AppRegistry,
StyleSheet,
} = React;
var AwesomeProject = React.createClass({
render: function(){return(
<NavigatorIOS
style={styles.container}
initialRoute={{
title: '首页',
component: Index,
}}
/>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
}
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
同级文件iospage下的Index.js
var React=require('react-native');
var {
StyleSheet,Text,View,Image,TouchableHighlight,ScrollView,
}=React;
var index=React.createClass({
render:function(){return (<View></View>);
}
});
module.exports=index;