scrimba
React Fundamentals - Components & Props
Component Basics
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

Component Basics
AboutCommentsNotes
Component Basics
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("Hello from JSX!", "Time to learn")}
{createCard("What's a component?", "Let's find out!")}
</div>
)

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