Answers for "styling multiple in react"

CSS
4

multiple styling react native

style={[
			styles.button,
			{ backgroundColor: 'green' }
		  ]}
Posted by: Guest on December-09-2020
2

how to add multiple style attributes in react element

style is just an Object, with css value turn to camelCase, so you could use any way to merge two object, and it should work.

ES6: style={Object.assign({}, style1, style2)}

ES7: style={{...style1, ...style2}}

lodash: style={_.merge({}, style1, style2)}
Posted by: Guest on January-12-2021

Browse Popular Code Answers by Language