【发布时间】:2016-07-31 23:33:54
【问题描述】:
我正在关注 iOS 的 React Native 教程:https://www.raywenderlich.com/126063/react-native-tutorial
由于 React-Native 中的 Android 教程缺乏,我试图将上面的 iOS 链接传输到 Android,但错误显示为:
我将NavigatorIOS 改为Navigator 内联:
'use strict';
//var React = require('react-native');
import React, {
AppRegistry,
Component,
Navigator,
Image,
ListView,
StyleSheet,
Text,
View
} from 'react-native';
var styles = React.StyleSheet.create({
text: {
color: 'black',
backgroundColor: 'white',
fontSize: 30,
margin: 80
},
container: {
flex: 1
}
});
class HelloWorld extends React.Component {
render() {
return <React.Text style={styles.text}>Hello World (Again)</React.Text>;
}
}
class PropertyFinderApp extends React.Component {
render() {
return (
<Navigator
style={styles.container}
initialRoute={{
title: 'Property Finder',
component: HelloWorld,
}}
/>
);
}
}
React.AppRegistry.registerComponent('PropertyFinder', function() { return PropertyFinderApp });
我对 React-Native 比较陌生,如何缓解这种情况?
【问题讨论】:
-
你想复制他们在文档中的例子吗..你似乎没有定义 renderScene...facebook.github.io/react-native/docs/navigator.html#content
-
@Abhay,有 Android React-Native 教程的来源吗?和我找到的一样吗?
-
我不知道,但我相信 react native 的全部意义在于它应该适用于两者 - 当然,某些功能可能依赖于本地。
标签: android react-native undefined-function