
总是觉得这种Wiring up的代码是evil的,有没有同感?
var MovieScreen = React.createClass({
render: function() {
return (
<ScrollView cOntentContainerStyle={styles.contentContainer}>
<View style={styles.mainSection}>
<Image
source={getImageSource(this.props.movie, 'det')}
style={styles.detailsImage}
/>
<View style={styles.rightPane}>
<Text style={styles.movieTitle}>{this.props.movie.title}</Text>
<Text>{this.props.movie.year}</Text>
<View style={styles.mpaaWrapper}>
<Text style={styles.mpaaText}>
{this.props.movie.mpaa_rating}
</Text>
</View>
<Ratings ratings={this.props.movie.ratings} />
</View>
</View>
<View style={styles.separator} />
<Text>
{this.props.movie.synopsis}
</Text>
<View style={styles.separator} />
<Cast actors={this.props.movie.abridged_cast} />
</ScrollView>
);
},
});
1 babyname 2015-04-01 08:55:43 +08:00 via iPhone 很丑 不过简单啊 |
2 yakczh 2015-04-01 09:20:09 +08:00 这才叫view |
3 icyflash 2015-04-01 09:36:35 +08:00 XAML 既视感 |
4 otakustay 2015-04-01 11:10:31 +08:00 写在哪里不是写,上面再封装一层很容易做分离的 |
5 Daizong 2015-04-01 11:35:02 +08:00 分离和混合各有利弊,适应就好 |
6 tokki 2015-04-01 11:41:33 +08:00 http://facebook.github.io/react-native/docs/videos.html#content |