Skip to content
seekho.
← Modern React, Next.js & TypeScript

Whole course on one page

Modern React, Next.js & TypeScript: 8 lessons, a few lines each. About 5 minutes to read. Use it to preview the course or to revise.

Foundations: TypeScript and Components

  1. 1. Why TypeScript? Labels on Every Box opens the one-minute view

    TypeScript is JavaScript with types. A type says what kind of value belongs in a place. Your editor warns you when a value does not fit.

    Steps: 1. Create a React + TypeScript project · 2. Write a type called Product · 3. Write a function that uses it · 4. Pass a wrong value on purpose · 5. Read the red underline

    ✗ Waiting until the app runs to find a wrong value ✓ Describe the data with a type and read the editor's warnings

    Words: Type, Compiler, Inference, Optional field

    📌 Types are labels that let the computer spot mistakes for you.

  2. 2. Components and Props: Lego Bricks for Your UI opens the one-minute view

    A component is a function that returns a piece of the screen. Props are the inputs you give it. One component can show many different things.

    Steps: 1. Write a ProductCard component · 2. Give its props a type · 3. Make an array of three products · 4. Show them with map · 5. Give every item a unique key

    ✗ Showing a list with map but giving the items no key ✓ Give each item a unique key, such as its id

    Words: Component, Props, JSX, Key

    📌 Build small pieces, then combine them. Data flows down through props.

Making Apps Interactive

  1. 3. State: The Component's Memory opens the one-minute view

    State is data that a component remembers and that can change. When you change state with its setter, React redraws the screen.

    Steps: 1. Call useState with a start value · 2. Show the value in your JSX · 3. Call the setter in a click handler · 4. Watch React redraw the screen · 5. Keep an input's text in state

    ✗ Changing state directly, like count = 5 ✓ Call the setter, like setCount(5)

    Words: State, Hook, Setter, Re-render

    📌 Change state with its setter, and React updates the screen for you.

  2. 4. Effects and Thinking in React opens the one-minute view

    An effect runs code after React draws the screen. Use it only to connect with things outside React, like a timer. Calculate everything else during render.

    Steps: 1. Ask: is this outside React? · 2. Set it up inside useEffect · 3. Add the dependency array · 4. Return a cleanup function · 5. Compute other values in render

    ✗ Using an effect to work out a total from state ✓ Calculate the total directly during render

    Words: Effect, Dependency array, Cleanup, Synchronise

    📌 Effects are for talking to the outside world, not for ordinary calculations.

Next.js App Router in Practice

  1. 5. Pages, Layouts and Routing with Folders opens the one-minute view

    In the Next.js App Router, each folder becomes part of a web address. A page.tsx file is the screen. A layout.tsx file wraps the pages.

    Steps: 1. Create a Next.js app · 2. Add a courses folder with page.tsx · 3. List course names as Links · 4. Add a [slug] folder with page.tsx · 5. Put a shared header in layout.tsx

    ✗ Reading params.slug without awaiting params ✓ Await params first, then read the slug

    Words: Framework, Page, Layout, Dynamic segment

    📌 Folders are addresses. Layouts are shared parts. Pages are the screens.

  2. 6. Server and Client Components opens the one-minute view

    Next.js components run on the server by default. They send finished HTML to the browser. Add "use client" only to parts that need clicks or state.

    Steps: 1. Fetch the list in a server component · 2. Make a small LikeButton file · 3. Use useState and onClick there · 4. Render the button inside the list · 5. Keep client components small

    ✗ Using useState in a server component file ✓ Move that part to a small file marked "use client"

    Words: Server component, Client component, Directive, Server Action

    📌 Do most work on the server. Use the client only for the interactive parts.

  3. 7. Shipping to Production: Performance and Deployment opens the one-minute view

    Before release, make the app fast and safe. Show the page at once and let slow parts load after. Run checks on every push, then deploy from Git.

    Steps: 1. Wrap the slow part in Suspense · 2. Run type checks and lint in CI · 3. Keep secrets in environment variables · 4. Run npm run build · 5. Deploy from your Git repository

    ✗ Putting a secret in a NEXT_PUBLIC_ variable ✓ Keep secrets in variables without that prefix

    Words: Streaming, Suspense, CI, Environment variable

    📌 Show something useful at once, and load the rest as it is ready.

  4. 8. Final Project: Course Catalogue App opens the one-minute view

    You build a small course catalogue with Next.js, React and TypeScript. It has a list page, a page for each course, a search box and a live address.

    Steps: 1. Define a Course type · 2. Build /courses as a server component · 3. Add the /courses/[slug] page · 4. Add a client search box · 5. Add Suspense, then deploy

    ✗ Making whole pages client components ✓ Keep client parts small and do the rest on the server

    Words: Course type, notFound(), Live URL

    📌 Types everywhere, server by default, small client parts, then deploy.

This page is a summary. It does not replace the lessons, where each idea has an example, pictures and practice.