gavinkwoe
V2EX  ›  问与答

React native 吐槽贴

  •  
  •   gavinkwoe · Apr 1, 2015 · 4014 views
    This topic created in 4242 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
    babyname
    Apr 1, 2015 via iPhone
    1
    很丑 不过简单啊
    yakczh
    yakczh
    Apr 1, 2015
    2
    这才叫view
    icyflash
    icyflash
    Apr 1, 2015
    3
    XAML 既视感
    otakustay
    otakustay
    Apr 1, 2015
    4
    写在哪里不是写,上面再封装一层很容易做分离的
    Daizong
    Daizong
    Apr 1, 2015
    5
    分离和混合各有利弊,适应就好
    tokki
    tokki
    Apr 1, 2015
    6
    他们 有两个视频啊 你看一下就明白他们的想法啦

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