This repository contains example code demonstrating various React features.
-
Vite+React: Shows the default output of running
npm create vite@latest, selectingReactandJavaScript + SWCas options, as of February 2023. -
Components, Logic & Loops: Demonstrates simple React components with props, use of the ternary operator (
?) and&&for conditional rendering, and iteration using themap()function. -
CSS Imports: Demonstrates how to import and use raw CSS files in react webapps.
-
CSS Modules: Demonstrates how to import and use CSS modules.
-
useState() Hook: Demonstrates how to give components local state using the
useState()hook. -
useEffect() Hook: Demonstrates how to have components give side-effects using the
useEffect()hook. -
Routing Examples: Demonstrates basic use of React Router, version 6 (NOT backwards compatible with older versions).
-
More Routing Examples: Demonstrates mode advanced use of React Router.
-
Consuming APIs: Demonstrates how we can use the axios library to make HTTP requests to our backend APIs.