- Dev Build
- Local Server
- HMR = Hot Module Replacement
- File Watching Algorithm - written in C++
- Caching - Faster Builds
- Image optimization
- Minification
- Bundling
- Compressing
- Consistent Hashing
- Code spliting
- Differencial Bundling
- Diagnostic
- Error Handling
- HTTPS hosting in development
- Tree Shaking - remove unused code
- Different dev and prod bundles
Types of Export/Import
-
default:
- export default Component;
- import Component from "path";
-
named:
- export const Component;
- import { Component } from "path";
(Normal JS utility functions)
- useState() - Super Powerful State Variable in React
- useEffect()
Whenever a state variable is changes React re-render the component
- Client side routing: page does not reload
- Server side routing: page reload
- Chunking
- code spliting
- dynamic bundling
- lazy loading
- dynamic import
- all above are different names for the same things
Higher order component is a function which takes a component as input and return enhanced version of the component.
const HigherOrderComponent = (Component) => {
return (props) => {
return (
<div>
<label>propmoted</label>
<Component {...props} />
</div>
);
};
};
- Install @reduxjs/toolkit and react-redux
- Build our store
- Connect our app to our app
- Create a slice (cart slice)
- Dispatch(action)
- Read data using Selector
- Unit Testing
- Integration Testing
- End to End Testing(E2E Testing)
- Install React Testing Library
- Install jest
- Install Babel dependency (required when using jest with Babel. We are using Babel as dependency of Parcel)
- Configure Babel
- Configure Parcel Config file to disable default Babel transpilation
- Jest configuration Command: npx jest --init
- Install jsdom library
- npm run test
- Install @babel/preset-react - to make JSX work in test cases
- Include @babel/preset-react inside my babel configuration
- Install @testing-library/jest-dom npm i -D @testing-library/jest-dom