Another React Project, just for Practice
Landing Page of Website
VS Code
- HTML
- CSS3
- Tailwind
React + Vite
npm run dev
- if else does not exit in jsx, thus use ternary operator because jsx is not a programming language but a syntax extension for xml
- Use {} brackets to use js in jsx file.
- Context is used when I want to pass the data of my parent component to its child component (sharing of data/variables within different components).
- useEffect hook is used when you want to render something the page is loaded for the first time.
- useContext is used when you want to share the content between parent and child component.
Remember 3 keywords while working with useContext
- createContext
- .Provider
- useContext
- Consider a Slice in redux as a Feature
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh