How do I write something that is equivalent to
CSS
.class {
display: flex;
display: -webkit-flex;
}
but using inline styles in React?
I'm basically looking for something like:
JavaScript
let styles = {
display: ['flex', '-webkit-flex']
}
How do I write something that is equivalent to
CSS
.class {
display: flex;
display: -webkit-flex;
}
but using inline styles in React?
I'm basically looking for something like:
JavaScript
let styles = {
display: ['flex', '-webkit-flex']
}
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... :)