Learning React with Web Dev Simplified (https://www.youtube.com/watch?v=Rh3tobg7hEo)
-
Library for native and web interface
-
front end frame work
-
features on top of normal javascript
-
html looking code is called jsx
- breakdown your code into components like text, video, image, then combine into one app
- I want my app to look like this
Think about making a sandwich- get a list of ingredients
- list the instructions
Go to a shop, ask for a sandwich - this is the react way of thinking
-
npm create vite@latest
-
? Project name: » vite-project (replace w period)
-
framework: React
-
index.html is where our script tag is imported
-
in src > assets > main.jsx
- hooks our html with react code
- everything inside the app is rendered in
-
in src > assets > App.jsx
- function that starts w capital letter is a component (ex. function App(){})
-
hooks: functions that allow you to reuse stateful logic
- there are 15 hooks in React version 18
-
helper functions
-
return value (what to display)
-
HOOKS:
- useCallback
- useContext
- useDebugValue
- useDeferredValue
- useEffect
- useId
- useImperativeHandle
- useInsertionEffect
- useLayoutEffect
- useMemo
- useReducer
- useRef
- useState
- useSyncExternalStore
- useTransition