In React you can clearly create an object and assign it as an inline style. i.e.. mentioned below.
var divStyle = {
For ones that looking this solution in React, If you want to use the spread operator inside style, you should use: babel-plugin-transform-object-rest-spread.
Install it by npm module and configure your .babelrc as such:
{
"presets": ["env", "react"],
"plugins": ["transform-object-rest-spread"]
}
Then you can use like...
const sizing = { width: 200, height: 200 }
More info: https://babeljs.io/docs/en/babel-plugin-transform-object-rest-spread/