V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
gavinkwoe
V2EX  ›  问与答

React native 吐槽贴

  •  
  •   gavinkwoe · 2015-04-01 08:52:23 +08:00 · 2878 次点击
    这是一个创建于 3306 天前的主题,其中的信息可能已经有所发展或是发生改变。

    总是觉得这种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>
    );
    },
    });

    6 条回复    2015-04-01 11:41:33 +08:00
    babyname
        1
    babyname  
       2015-04-01 08:55:43 +08:00 via iPhone
    很丑 不过简单啊
    yakczh
        2
    yakczh  
       2015-04-01 09:20:09 +08:00
    这才叫view
    icyflash
        3
    icyflash  
       2015-04-01 09:36:35 +08:00
    XAML 既视感
    otakustay
        4
    otakustay  
       2015-04-01 11:10:31 +08:00
    写在哪里不是写,上面再封装一层很容易做分离的
    Daizong
        5
    Daizong  
       2015-04-01 11:35:02 +08:00
    分离和混合各有利弊,适应就好
    tokki
        6
    tokki  
       2015-04-01 11:41:33 +08:00
    他们 有两个视频啊 你看一下就明白他们的想法啦

    http://facebook.github.io/react-native/docs/videos.html#content
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2747 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.