General rundown
Suggested rundown for teaching react.js usage in 2025 onwords.
Suggested flow
The flow is assumed that student is already know about the basic coding concepts about javascript or typescript.
Required knowledge:
- Variables
- Conditions
- Basic HTML & CSS
- Basic DOM Control
Better to have:
- Async / Await using
- API Calling with fetch / network
- Typescript
1. Starting a new project with Vite.js
- Download VSC (https://code.visualstudio.com )
- Download Node.js (https://nodejs.org/en )
- Open a project / folder at VSC
- How to open / use the terminal (
ls,cd,npm) - Init a get started project from
Vite.js(https://vite.dev/guide/ ) - Type in
npm run devto open a development project - How to espace the dev server by
Ctrl + C - Type
npm run buildto build the output
Remindings:
- Try to ask for your student about their experience about their develop skills.
- Attempt to slow it down for the first lessons depends on their experiences.
- IT background student are recommended to use
typescriptinstead ofjavascript.
1.1 Starting with Typescript (Bonus)
- Types for javascript (
number,boolean,string,array,null) - Types with
functions -
TypeandInterfacedefine -
ObjectsandArraylevel types - Bonus: Generics in typescript (
function<T> (arg:T):T{})
2. Introduce to React Usage
- Navigating with
Get startedproject folder structure (app,.tsx / .jsx) - DOM tags usage in react (
h1,h2,p,div,br,span) - What is a Components in react
- Basic
inline/classCSS for components - Create a new Components file (
MyComponents.tsx) (Care the naming withCapital letter) - Clone and play with basic components
Remindings:
- Try to explain the benefic of
Components modularizationin web development
3. Play around with import and export with functions / Components
- Brief introduce to
importandexportfor js / ts - Different of
exportandexportdefault - How to write a Components for
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
- Passing general
propsto component (number,string,boolean,null) - Define
propstypes to component with typescript (interface) - Define optional / default props
- Playing with conditions rendering (
if,true ? "A" : "B";,{}) - Render list by looping (
forvs.map()vs.forEach()) - Pure thinking: How to split / design a component
- React Fragment
<></> - Passing
Callback functionas a props - Passing
Componentsas a props
5. Deep drive lifecycle with useState and useEffects
- Introduce to
useStatefor variables rendering - 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
useState change functionas a props to components [Advance knowledge Point] - Introduce Render cycle for react (
didComponentMount,didComponentDismount) - Introduce to
useEffectin Render cycle stages - Play around the side effects in
useEffect([],[variables]) - Using
SetIntervalinuseEffect - Clear side effect with
SetInterval(Render cycle inuseEffect,return () => { clearInterval }) - Bonus: More with
useMemo,useCallbackanduseRef
6. Paging with React Route Dom (RRD)
- Install
React Route 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. Trending zustand to replace redux tools kit
- Global variables with RTK replacement passing (
zustand) - Install
zustandin the project https://github.com/pmndrs/zustand - Config a single
useStoreinstorefolder (FunctionsandVariables) - Use the store file in components
- Introduce the plugins in zustand (
localstore,devtools) - You may not need
zustand- Introduce when and how you have decided to use this method
8. Using CSS framework
- Using a modern CSS framework (
Mantine) - Install
Mantinein the project https://mantine.dev/getting-started/ - How to config / import the
Provider - General brief of how to view the documents and usage
- How to adapts the build-in components into the projects (
Buttons,Container,Grid…) - How to select sutiable tools / library for your project
9. Deploy with Vercel and Github
- Registe a 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 - Config the
vercel.json - Using public
.envat Vite - Create env for
developmentandproductions
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. Advance React technique 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 adaptions - Using
vite-plugin-sitemapfor Site map genetations - Importing
gooogle 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. Introduce to Next.js
- What is
Next.jsand why using items - Init a project with
Next.js - Introduce to
Page routing - Introduce to
CSR,SSRandSSG(Client Time, Runtime Server, Build time)
Reading Materials
Vite.js
react.dev
Last updated on