title: How to write inline styles for html tags in React?
body: <p>I want to set a header tags styling froma top level component, something like this:</p>
  
  <pre><code> &lt;div style={{
          ['h2']: {
              backgroundColor: 'red'
          }
      }}&gt;
          &lt;h2&gt;test&lt;/h2&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Where 'test' would have a red background, I can't do this any other way as in my use case I get a JSX Element as a variable that contains a h2 element, I cannot emphasise enough the top example with  is overly simplified and I cannot access the h2 tag in any obvious way in the real use case where I have to do something like {props.children}</p>