import React, { Component } from 'react';
import { View, Text, StyleSheet, TouchableHighlight } from 'react-native';
class First extends Component {
render() {
return (
<View style = {styles.container}>
<Text>
Hello world!
</Text>
</View>
);
}
}
const styles = StyleSheet.create ({
container: {
backgroundColor: 'yellow',
flex: 1
}
});
module.exports = First;
を振る舞うFlexはreact-native init
で始まったが、create-react-native-app
で始まったプロジェクトで何も表示されません。これは正常ですか?はネイティブリアクト:このコードは、プロジェクトに黄色で画面いっぱいに異なっ
編集:これは、メインApp.jsのスタイルView
から誤って呼び出されました。
"_ただし、同じことをしていません"、他に何がありますか? –
@KhalilKhalaf何も表示されません。 –