React.js 样式组件:React Style点这里

 

React Style 是 React.js 可维护的样式组件。使用 React Native StyleSheet.create一样的样式。

完全使用 JavaScript 定义样式:

1
2
3
4
5
6
7
var StyleSheet = require('react-style')
var styles = StyleSheet.create({
    foo: {
      color: 'red',
      backgroundColor: 'white'
    }
})

样式 React 组件:

1
2
3
4
5
6
7
8
9
10
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>
  }
 
}

 

https://github.com/js-next/react-style

 

相关文章:

  • 2021-07-07
  • 2021-09-19
  • 2021-10-31
  • 2021-09-20
  • 2022-12-23
  • 2021-10-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2019-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
相关资源
相似解决方案