import React from "react";
class App extends React.Component {
render() {
var formula = "<div> hello </div>"
const div = document.createElement("div")
div.innerHTML = formula
return (
<div>
{div}
</div>
);
}
}
export default App;
I get an error
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.
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
My original code has something like this littered throughout my code in recursions too
var formula = "<div>"
formula = formula + "something"
formula = formula + "</div>