gavinkwoe
V2EX  ›  问与答

React native 吐槽贴

  •  
  •   gavinkwoe · Apr 1, 2015 · 3637 views
    This topic created in 4073 days ago, the information mentioned may be changed or developed.

    总是觉得这种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 replies    2015-04-01 11:41:33 +08:00
    babyname
        1
    babyname  
       Apr 1, 2015 via iPhone
    很丑 不过简单啊
    yakczh
        2
    yakczh  
       Apr 1, 2015
    这才叫view
    icyflash
        3
    icyflash  
       Apr 1, 2015
    XAML 既视感
    otakustay
        4
    otakustay  
       Apr 1, 2015
    写在哪里不是写,上面再封装一层很容易做分离的
    Daizong
        5
    Daizong  
       Apr 1, 2015
    分离和混合各有利弊,适应就好
    tokki
        6
    tokki  
       Apr 1, 2015
    他们 有两个视频啊 你看一下就明白他们的想法啦

    http://facebook.github.io/react-native/docs/videos.html#content
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3259 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 12:16 · PVG 20:16 · LAX 05:16 · JFK 08:16
    ♥ Do have faith in what you're doing.