General Run-down
Suggested run-down for teaching React.js usage in 2025 onwards.
Suggested flow
The flow assumes the student already knows the basic coding concepts of JavaScript or TypeScript.
Required knowledge:
- Variables
- Conditions
- Basic HTML & CSS
- Basic DOM Control
Better to have:
- Async / await usage
- API calling with fetch / network
- TypeScript
1. Starting a new project with Vite.js
- Download VS Code (https://code.visualstudio.com )
- Download Node.js (https://nodejs.org/en )
- Open a project / folder in VS Code
- How to open / use the terminal (
ls,cd,npm) - Initialize a starter project with
Vite.js(https://vite.dev/guide/ ) - Type in
npm run devto open a development project - How to stop the dev server with
Ctrl + C - Type
npm run buildto build the output
Reminders:
- Ask your student about their prior development experience.
- Slow it down for the first lessons depending on their experience level.
- Students with an IT background are recommended to use
TypeScriptinstead ofJavaScript.
1.1 Starting with TypeScript (Bonus)
- Types for JavaScript (
number,boolean,string,array,null) - Types with
functions -
typeandinterfacedefinitions -
ObjectsandArraylevel types - Bonus: Generics in TypeScript (
function<T>(arg: T): T {})
2. Introduction to React
- Navigating the
Get startedproject folder structure (app,.tsx / .jsx) - DOM tag usage in React (
h1,h2,p,div,br,span) - What is a component in React
- Basic
inline/classCSS for components - Create a new component file (
MyComponents.tsx) (Pay attention to thecapitalletter) - Clone and play with basic components
Reminders:
- Explain the benefit of component modularization in web development.
3. Play around with import and export for functions / components
- Briefly introduce
importandexportfor JS / TS - Difference between
exportandexport default - How to write a component with
export/import - How to write a function for
export/import - Function with params
- Arrow functions for React
- Suggested folder structure for React (
Utils,Pages,Store,Components,Types…)
4 Playing with props
- Passing general
propsto a component (number,string,boolean,null) - Define
propstypes for a component with TypeScript (interface) - Define optional / default props
- Playing with conditional rendering (
if,true ? "A" : "B";,{}) - Render a list by looping (
forvs.map()vs.forEach()) - Pure thinking: How to split / design a component
- React Fragment
<></> - Passing a
callback functionas a prop - Passing
componentsas props
5. Deep dive lifecycle with useState and useEffect
- Introduce
useStatefor rendering variables - Basic DOM interactions (
onClick,onChange,onInput) - Playing with
useStatefor content changes / interactions - Callback vs Passing self in
useState(setCounter( v => v + 1 )vssetCounter(counter + 1)) - Using the
useStateupdate function as a prop to components [Advanced knowledge point] - Introduce the render cycle for React (
didComponentMount,didComponentDismount) - Introduce
useEffectin render cycle stages - Play around the side effects in
useEffect([],[variables]) - Using
setIntervalinuseEffect - Clear side effects with
setInterval(render cycle inuseEffect,return () => { clearInterval }) - Bonus: More with
useMemo,useCallbackanduseRef
6. Paging with React Router DOM (RRD)
- Install
React Router DOM (RRD) - Introduce paging in React with
RRD - Writing a simple useRoute config file with
BrowserRouter - Navigate in
RRD(<Link>oruseRoute) -
ParamsandQuerypassing inRRD - Overlay in
RRD(React.Children) - Bonus: Using
React.lazyto increase UX
7. Using zustand to replace the Redux toolkit
- Global variables with RTK replacement (
zustand) - Install
zustandin the project https://github.com/pmndrs/zustand - Configure a single
useStorein thestorefolder (FunctionsandVariables) - Use the store file in components
- Introduce the plugins in
zustand(localstore,devtools) - You may not need
zustand; introduce it when and how you decide to use this method
8. Using a CSS framework
- Using a modern CSS framework (
Mantine) - Install
Mantinein the project https://mantine.dev/getting-started/ - How to configure / import the
Provider - A brief overview of the documentation and usage
- How to adapt the built-in components into the project (
Buttons,Container,Grid…) - How to select suitable tools / libraries for your project
9. Deploy with Vercel and Github
- Register an account for
GithubandVercel - Download
gitandGithub Desktop - Create a project repo
- Push the file to repo
- Register a Vercel account
- Operate with Vercel UI
- Deploy with Github
- View and debug the
Githubdeployment - Configure the
vercel.json - Using public
.envat Vite - Create env for
developmentandproduction
9.1 Mini-project - Todo List
- A UI view for a todo list
- View the todo list
- Create records for todo
- Delete records for todo
- Edit records for todo
- Delete all records
- Bonus - Mark as important / read todo
- Bonus - Record the create time
- Bonus - Search the todo items
- Bonus - Record in local-storage
10. Advanced React techniques for UX / UI (Bonus)
- Using
react-helmet-asyncfor SEO - Using
react-error-boundaryfor Avoid Error UI failed - Using
react-hot-toastfor notifications feedback - Using
@vite-pwa/pwafor PWA adaptations - Using
vite-plugin-sitemapfor sitemap generation - Importing
Google Search Consolefor search analysis - Using Vite
defineConfigconditions andesbuild drop console - Using
react-infinite-scrollerfor data lazy loading - Using
react-lazy-load-image-componentfor images lazy loading
11. Introduction to Next.js
- What is
Next.jsand why use it - Initialize a project with
Next.js - Introduce
Page routing - Introduce
CSR,SSR, andSSG(Client time, server runtime, build time)
Reading Materials
Vite.js
react.dev
Last updated on