I’ve been enhancing my skills and solidifying my foundation in the React.js Tech stack by diving deep into it’s concepts and techniques while embracing project "online Food Delivery App" based learning. Throughout the project, I’ve learned various React.js concepts from scratch such as: Parcel for packaging Apps, Babel for transpiling JSX to JavaScript, React Components - class based and functional component, Props and imports/ exports, Fetching live data via API calls, Concept of React Fiber and Diff Algorithm for optimizing DOM, React Hooks - useState and useEffect, Routing for creating seamless navigation between components, Custom Hooks, Advanced styling with Tailwind CSS, Redux Toolkit for efficient state management. Testing: Manual, unit and integration using Jest and jsdom environment.
-Dev Build -Local Server -HMR = Hot Module Replacement -File Watching Algorithms - written in C++ -Caching - Faster Builds -Image Optimization -Minification -Bundling -Compress -consistent Hashing -code spliting -Differential Bundling - support older browsers -Diagnostic = show beautiful error -Error Handling -HTTPS -Tree Shaking - remove unused code -Different dev and prod bundles
/**
- Header
- -Logo
- -Nav Items
- Body
- -Search
- -RestaurantContainer
-
-Img -
-Name of Res, star Rating, cuisine, delivery time - Footer
- -Copyright
- -Links
- -Address
- -Contact */
1-Default Export/Import export default components; import Component from "path"; 2-Named Export/Import export const Component; import {Componenr} from "path";
(Normal JS utility Functions) -useState() -useEffect() Note- 1.if no dependency array => useEffect is called on every render 2.if dependency array is empty=[] => useEffect is called on intial render(just once) 3.if dependency array is [btnNameReact] => called everytime btnNameReact is updated
-Client Side Routing -Server Side Routing
- Class Based Component
- Functional Based Component
- render phase
- commit phase if there are multiple children, how life cycle order work in class based component: -Parent Constructor -Parent render -FirstChild render -FirstChild constructor -SecondChild constructor -SecondChild render <DOM UPDATED -IN SINGLE BATCH> -FirstChild ComponentDidMount -SecondChild ComponentDidMount -Parent componentDidMount
- Install @reduxjs/toolkit and react-redux (two library)
- Build our store
- Connect our store to our app
- Slice (cartSlice)
- dispatch (action)
- Selector
- Unit Testing
- Integration Testing
- End to End Testing - e2e testing
- Install React Testing Library
- Installed jest
- Installed Babel dependencies
- Configure Babel
- Configure Parcel Config file to disable default babel transpilation
- Jest configuration ( npx jest --init )
- Install jsdom library
- Install @babel/preset-react - to make jsx work in test cases
- Include @babel/preset-react inside my babel config
- npm i -D @testing-library/jest-dom