How to combine multiple inline style objects?

后端 未结 17 1528
难免孤独
难免孤独 2020-11-28 18:54

In React you can clearly create an object and assign it as an inline style. i.e.. mentioned below.

var divStyle = {
          


        
17条回答
  •  借酒劲吻你
    2020-11-28 19:54

    I have built an module for this if you want to add styles based on a condition like this:

    multipleStyles(styles.icon, { [styles.iconRed]: true })
    

    https://www.npmjs.com/package/react-native-multiple-styles

提交回复
热议问题