How to use createElement in React JS?
The component function returns the result from the React.createElement method, React can use that HTML element to add content in Domain Object Model (DOM).
Example
import React, { Component } from 'react';
export default function App() {
return React.createElement("h1",
{ className: "bg-secondary text-white text-center p-2" },
"Hello World");
}
Most Helpful This Week
Check checkbox is Checked or Unchecked
How to create Functional Component?
React Components
How to get a clicked HTML element in React?
onMouseDown and onMouseUp Event handling in ReactJs
How to show hide component on Click in React JS?
State and Props in React
Display JSON Data in React JS
React Elements
Loop inside React JSX