I have a JSON string created by API:
var appStructure = {
"code": 200,
"message": "Register Form Loaded.",
"response": "'div',{},'Registration'"
};
I want to create element dynamically using the API response. I am trying to do something like this:
var testCard1 = React.createElement(appStructure.response);
ReactDOM.render(testCard1, document.getElementById('main-content'));
But it keep giving me the error
Warning: is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements. Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('h1',{},'Hello Testing') is not a valid name.