scrimba
React Fundamentals
React Fundamentals: JSX Bonus - Fragments
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

React Fundamentals: JSX Bonus - Fragments
AboutCommentsNotes
React Fundamentals: JSX Bonus - Fragments
Expand for more info
index.js
run
preview
console
import React from "react"
import ReactDOM from "react-dom"

function createCard(greeting, subheader) {
return (
<div>
<h1>{greeting}</h1>
<h2>{subheader}</h2>
</div>
)
}

const element = (
<div>
{createCard("What are fragments?", "Let's find out!")}
{createCard("Hello from JSX!", "Time to learn")}
</div>
)

ReactDOM.render(element, document.getElementById("root"))
Console
/index.html
-2:35