title: Is it possible to set a String as html element then use innerhtml on it in react?
body: <pre><code>import React from &quot;react&quot;;
  
  class App extends React.Component {
      render() {
  
          var formula = &quot;&lt;div&gt; hello &lt;/div&gt;&quot;
          
          const div = document.createElement(&quot;div&quot;)
          div.innerHTML = formula
  
          return (
  
              &lt;div&gt;
  
                  {div}
  
              &lt;/div&gt;
  
  
  
          );
      }
  }
  
  export default App;
  </code></pre>
  <p>I get an error</p>
  <pre><code>Error: Objects are not valid as a React child (found: [object HTMLLIElement]). If you meant to render a collection of children, use an array instead.
  </code></pre>
  <p>Basically the string has html elements I want to set inner html to the div constant. Right now yeah its relatively simple I just need to know if this can be done</p>
  <p>My original code has something like this littered throughout my code in recursions too</p>
  <pre><code>var formula = &quot;&lt;div&gt;&quot;
  formula = formula + &quot;something&quot;
  formula = formula + &quot;&lt;/div&gt;
  </code></pre>