title: How to pass variables to inline css function in React
body: <p>I' ve managed to create class in React and wanted to set random generated background to div container. Const variable named divStyle does include CSS function rbg() but I just can't find solution to Pass variables from this.state to that function</p>
  
  <pre><code>import React from 'react';
  import './ShopItem.css';
  
  class ShopItem extends React.Component{
  constructor(props){
      super(props);
      this.state = {
          r:Math.floor(Math.random() * 256),
          g:Math.floor(Math.random() * 256),
          b:Math.floor(Math.random() * 256)        
      }
  }
  
  componentDidMount() {
      console.log(this.state.r, this.state.g, this.state.b);
  } 
  
  render(){
  
      const divStyle = {
          background: "rgb()"
      };
  
      return(
          &lt;div className="Item" style={divStyle} &gt;
              {console.log("test")}
              {this.props.data}
          &lt;/div&gt;
      );
  };
  };
  
  export default ShopItem;
  </code></pre>