React Style React.js 样式组件 项目简介
React Style 是 React.js 可维护的样式组件。使用 React Native StyleSheet.create 一样的样式。完全使用 JavaScript 定义样式:var StyleSheet = require('react-style')
var styles = StyleSheet.create({
foo: {
color: 'red',
backgroundColor: 'white'
}
})样式 React 组件:var React = require('react')
class HelloWorld extends React.Component{
render() {
var dynamicStyles = {color: this.props.color}
return <div styles={[styles.foo, dynamicStyles]}>Hello, world!</div>
}
}
var styles = StyleSheet.create({
foo: {
color: 'red',
backgroundColor: 'white'
}
})样式 React 组件:var React = require('react')
class HelloWorld extends React.Component{
render() {
var dynamicStyles = {color: this.props.color}
return <div styles={[styles.foo, dynamicStyles]}>Hello, world!</div>
}
}