JSX
JSX
You may also use curly braces to embed a JavaScript expression in an attribute.
const el = <h1 className={ac.tab}>Hello</h1>
const el = React.createElement("h1", {
className: "bg"
}, "Hello");
const el = {
type: 'h1',
props: {
className: 'bg',
children: 'Hello'
}
};
Nested Elements
You can provide more JSX elements as the children. This is useful for
displaying nested components.
Ex:-
<MyContainer>
<MyFirstComponent />
<MySecondComponent />
</MyContainer>