let x
=>
.map()
<div>
color: teal
______
______
Theebug
Theebug — Learn to Code by Doing
Light
Start Learning
Explorer
···
▼
THEEBUG
index.tsx
learn.md
docs.md
about.md
faq.md
leaderboard.md
updates.md
learn.md
THEEBUG
›
learn.md
Browse more courses
React
Components, props, state, and the hooks that power modern React apps.
Start Course
Beginner
3 levels
01 — lesson1.jsx
easy
JSX & Components
1
function Greeting() {
2
return <h1>Hello, [ ___ ]!</h1>;
3
}
Complete the JSX so the component renders "Hello, world!"
Play
02 — lesson2.jsx
easy
Props
1
function Welcome([ ___ ]) {
2
return <p>Hello, {name}!</p>;
3
}
4
5
<Welcome name="Ada" />
Destructure the name prop so the component greets whoever it's passed
Play
03 — lesson3.jsx
easy
State with useState
1
import { useState } from "react";
2
3
function Counter() {
4
const [count, setCount] = [ ___ ](0);
5
return <p>Count: {count}</p>;
Call useState so the counter has somewhere to keep its count
Play
Intermediate
2 levels
04 — lesson4.jsx
medium
Event Handling
1
function Counter() {
2
const [count, setCount] = useState(0);
3
return (
4
<button [ ___ ]={() => setCount(count + 1)}>
5
Clicked {count} times
Wire up the button so clicking it increases the count
Play
05 — lesson5.jsx
medium
Conditional Rendering
1
function Status({ isOnline }) {
2
return <p>{isOnline [ ___ ] "Online" : "Offline"}</p>;
3
}
Complete the ternary so the status text matches whether the user is onli…
Play
Advanced
1 level
06 — lesson6.jsx
hard
Rendering Lists & Keys
1
function FruitList({ fruits }) {
2
return (
3
<ul>
4
{fruits.map((fruit) => (
5
<li [ ___ ]={fruit}>{fruit}</li>
Add the key prop React needs to track each item in the rendered list
Play
main
UTF-8
Markdown