scrimba
Frontend Career Path
React basics
Meme generator
Dynamic styles
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

To see this lesson you need to be logged in. Joining Scrimba is free and gives you access to 20+ courses.Sign up
AboutCommentsNotes
Dynamic styles
Expand for more info
App.js
run
preview
console
import React from "react"
import boxes from "./boxes"

export default function App() {
const [squares, setSquares] = React.useState(boxes)

const squareElements = squares.map(square => (
<div className="box" key={square.id}></div>
))
return (
<main>
{squareElements}
</main>
)
}
Console
/index.html
-5:42