Writing more Complex Elements using JSX
We can combine multiple JSX elements or components into one big element and render it into the root. For example we can create a heading
and a paragraph
element and embed it into a <div>
element:
index.html
If you look at the above code, we have created the element main
using two other elements, heading
and paragraph
.
We used the expression embedding syntax {}
to embed other elements inside the main <div>
and rendered it through the root's render method. This can be repeated as many times as wanted to create further complex elements.
Tak for dine kommentarer!
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Spørg mig spørgsmål om dette emne
Opsummér dette kapitel
Vis virkelige eksempler
Awesome!
Completion rate improved to 2.7
Writing more Complex Elements using JSX
Stryg for at vise menuen
We can combine multiple JSX elements or components into one big element and render it into the root. For example we can create a heading
and a paragraph
element and embed it into a <div>
element:
index.html
If you look at the above code, we have created the element main
using two other elements, heading
and paragraph
.
We used the expression embedding syntax {}
to embed other elements inside the main <div>
and rendered it through the root's render method. This can be repeated as many times as wanted to create further complex elements.
Tak for dine kommentarer!