Tobias Tobias - 1 year ago 71
CSS Question

Multiple properties in ReactJS inlined styles object?

How do I write something that is equivalent to


.class {
display: flex;
display: -webkit-flex;

but using inline styles in React?

I'm basically looking for something like:


let styles = {
display: ['flex', '-webkit-flex']

Answer Source

Your problem is a reactJS common problem still opened and waiting for a proper solution

For webkit style, one solution is to concat values:

let styles = {
  display: 'flex; display:-webkit-flex'

Otherwise, a more common solution is to create a CSS named 'flex' that will be given to the className property of your element.

Third solution: use Radium. I believe it too big & tedious for your problem but you can try it if you have time... :)