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
How to use React-Bootstrap component?
React JS get Tag Name and Inner Text on Click
How to build and use a custom react component from scratch?
Loop inside React JSX
Create React App
3 Different Examples - How State Works in React?
Integrate Bootstrap with ReactJS Application
How to get a clicked HTML element in React?
Working with Forms, Inputs and onChange Events in ReactJs
Display JSON Data in React JS