create elent inside function in react code example
Example 1: react.createelement
React.createElement(
type,
[props],
[...children]
)
Example 2: react createelement
class Greeting extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}