Section 6: Loading Data with useEffect and Custom Hooks
- When to use useEffect, and when you do not need it
- Call a REST API with the Fetch API or Axios
- Show loading and error states to the user
- Move data loading code into a custom hook for reuse
- Lab: a product list page that loads data from an API
Section 7: Lab: Multi-page Apps with React Router
- Install React Router and define routes with BrowserRouter, Routes and Route
- Link and NavLink, with the current link highlighted
- Read URL values with useParams and query strings with useSearchParams
- Shared layouts with nested routes and Outlet
- Navigate with useNavigate, protect pages that need a login and add a 404 page
Section 8: Forms in React
- Controlled inputs and keeping form values in state
- React 19 form actions with useActionState and useFormStatus
- React Hook Form for forms with many fields
- Validate data with Zod and show error messages
- Lab: registration and login forms
Section 9: Lab: CRUD with a REST API
- Set up a mock REST API locally and test it with Postman or Bruno
- Read, create, update and delete data from React pages
- Refresh the screen after saving and confirm before deleting
- Keep the API URL in a .env file and understand CORS issues
- Lab: a product management CRUD app with React and Bootstrap
Section 10: Workshop: Building and Deploying a React App
- Check the project before deployment and create a production build with Vite
- Deploy to GitHub Pages, Netlify or Vercel
- Fix fallback URL issues in single page applications
- Use an AI assistant to explain and fix code, and check the result yourself
- Next steps towards TypeScript, Next.js and React Native