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
Example of React Bootstrap Datatable
React JS Count number of checkboxes are checked
Create Functional Component using ES6 Arrow Syntax
Create React App
How to create simple React Router to navigate multiple pages?
How to create Functional Component?
How to handle events using expressions inside JSX?
How to pass data from child component to its parent in ReactJS?
What is JSX?
onMouseDown and onMouseUp Event handling in ReactJs