【发布时间】:2016-12-11 10:24:08
【问题描述】:
我需要使用静态默认样式表样式提供动态内联样式。我怎样才能做到这一点
<View
style={[styles.card,{{width:width, height: height}}]}>
<View style={styles.card}>
<Text>
<Image
source={{uri: this.props.media.image_url}}
style={{width:width, height: this.props.media.height}}/>
</Text>
</View>
</View>
上面的代码不适合我。
【问题讨论】:
-
如果您要进行服务器渲染,您将来可能需要更改一些内容,因为服务器渲染不支持样式加载器
-
服务器渲染有什么解决方案?
-
使用github.com/webpack/extract-text-webpack-plugin这会将所有css合并到一个文件中。
-
这是 React Native,服务器渲染不是问题。
标签: reactjs react-native react-router flux