how to avoid using document.createelement inr eact code example
Example 1: React.createElement
class Hello extends React.Component {
render() {
return React.createElement('div', null, `Hello ${this.props.toWhat}`);
}
}
ReactDOM.render(
React.createElement(Hello, {toWhat: 'World'}, null),
document.getElementById('root')
);
Example 2: react.createelement
React.createElement(
type,
[props],
[...children]
)