# REACT | Basis

# Les 1 - Introductie React

🎯 Leerdoelen

- Je weet wat React is.
- Je kunt Node.js installeren.
- Je kunt een React-project starten.
- Je begrijpt de projectstructuur.

💡 Uitleg

- Front-end versus Back-end
- Waarom React?
- npm
- package.json
- src
- public
- App.jsx

🛠️ Opdracht

Maak een nieuwe React-app.

Pas App.jsx aan zodat deze laat zien:

```
Welkom bij mijn eerste React applicatie!

Naam:
Studentnummer:
Klas:
```

<div class="relative w-full mt-4 mb-1" id="bkmrk-"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--1"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>🧠 Reflectie

- Waarom gebruiken we React?
- Welke map bevat jouw code?

📤 Inleveren

Screenshot van draaiende applicatie.

---

# Les 2 - JSX en Componenten

🎯 Leerdoelen

- JSX begrijpen
- Eerste component maken
- Props gebruiken

💡 Uitleg

- JSX
- className
- Componenten
- Props

🛠️ Opdracht

Maak:

```
Header.jsx

Footer.jsx

GameCard.jsx
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--3"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--4"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Gebruik vervolgens:

```
<GameCard
 title="Minecraft"
 platform="PC"
/>
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--5"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--6"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>🧠 Reflectie

Wat is het voordeel van componenten?

📤 Inleveren

Screenshot + code.

---

# Les 3 - useState

🎯 Leerdoelen

- useState gebruiken
- State wijzigen
- Events afhandelen

💡 Uitleg

- useState
- onClick
- Rendering

🛠️ Opdracht

Maak:

✔ Teller

```
Aantal games:
0

[ + ]

[ - ]
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--8"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--9"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Daarna:

Favoriet aan/uit

❤️

🤍

🧠 Reflectie

Waarom gebruiken we state?

---

# Les 4 - Lijsten met map()

🎯 Leerdoelen

- Arrays tonen
- map()
- key

💡 Uitleg

Array →

```
[
{
title:"Minecraft"
}
]
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--11"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--12"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>→ GameCards

🛠️ Opdracht

Toon vijf games.

Extra:

voeg afbeelding toe.

---

# Les 5 - Formulieren

🎯 Leerdoelen

- Input
- onChange
- Zoeken

🛠️ Opdracht

Maak een zoekveld.

```
Zoeken:

Minecraft
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--14"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--15"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Alleen passende games blijven zichtbaar.

---

# Les 6 - JSON laden

🎯 Leerdoelen

- JSON begrijpen
- fetch()
- useEffect()

💡 Uitleg

```
games.json
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--17"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--18"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>in

```
public/
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--19"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--20"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Inladen met

```
fetch()
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--21"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--22"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>🛠️ Opdracht

Laad:

```
games.json
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--23"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--24"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Toon alle games.

---

# Les 7 - Details tonen

🎯 Leerdoelen

- State combineren
- Eén geselecteerde game tonen

🛠️ Opdracht

Klik op een game.

Rechts verschijnt

```
Naam

Platform

Genre

Beschrijving
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--26"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--27"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>---

# Les 8 - Favorieten

🎯 Leerdoelen

- Arrays aanpassen
- State uitbreiden

🛠️ Opdracht

Maak

⭐ Favoriet

Filter:

```
Alle

Favorieten
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--29"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--30"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>---

# Les 9 - AI Challenge

🎯 Leerdoelen

AI gebruiken.

🛠️ Opdracht

Laat ChatGPT een React-component maken.

Bijvoorbeeld:

```
Rating sterren

of

Dark Mode

of

Sorteerfunctie
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--32"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--33"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Verbeter de code zelf.

Lever ook je prompt in.

---

# Les 10 - Eindopdracht

Maak jouw eigen Game Collection.

Verplicht:

✅ Header

✅ Footer

✅ Componenten

✅ JSON

✅ useState

✅ useEffect

✅ Zoekfunctie

✅ Favorieten

Keuze:

⭐ Dark Mode

⭐ Eigen styling

⭐ React Icons

⭐ Categorieën

⭐ Eigen JSON

---

# Bonuslessen

## Les 11

React Router

```
/

Games

/game/3
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--36"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--37"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>---

## Les 12

Externe API

Bijvoorbeeld:

```
https://dummyjson.com/products
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--39"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--40"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>of

```
RAWG Game API
```

<div class="relative w-full mt-4 mb-1" id="bkmrk--41"><div class=""><div class="contents"><div class="relative"><div class="h-full min-h-0 min-w-0"><div class="h-full min-h-0 min-w-0"><div class="border border-token-border-light border-radius-3xl corner-superellipse/1.1 rounded-3xl"><div class="h-full w-full border-radius-3xl bg-token-bg-elevated-secondary corner-superellipse/1.1 overflow-clip rounded-3xl lxnfua_clipPathFallback"><div class="relative"><div class="pe-11 pt-3"><div class="relative z-0 flex max-w-full"><div class="q9tKkq_viewer cm-editor z-10 light:cm-light dark:cm-light flex h-full w-full flex-col items-stretch ͼs ͼ16" dir="ltr" id="bkmrk--42"><div class="cm-scroller"></div></div></div></div></div></div></div></div></div><div class=""><div class="">  
</div></div></div></div></div></div>Studenten leren echte API's gebruiken.

---

# AI-opdracht in iedere les

Net als bij SQL.

Bijvoorbeeld:

🤖 AI-opdracht

Vraag ChatGPT:

> Leg uit wat useState doet alsof je het uitlegt aan een eerstejaars mbo-student.

Controleer daarna zelf of de uitleg klopt.