react createElement function code example
Example 1: react memo
function MyComponent(props) {
}
function areEqual(prevProps, nextProps) {
}
export default React.memo(MyComponent, areEqual);
Example 2: react.createElement
var reactNodeLi = React.createElement('li', {id:'li1'}, 'one');
Example 3: react.createelement
React.createElement(
type,
[props],
[...children]
)
Example 4: React.createElement
const e = React.createElement;
ReactDOM.render(
e('div', null, 'Hello World'),
document.getElementById('root')
);