4 |
5 |
6 |
7 | Namaste React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/E02_Igniting/notes/notes.md:
--------------------------------------------------------------------------------
1 | # Parcel
2 | Parcel is a web application bundler, often referred to as a "zero configuration" bundler, which means it requires minimal to no configuration to bundle and build your web application. It simplifies the build process by automatically analyzing and bundling your project's dependencies and assets.
3 |
4 | Key features of Parcel include:
5 |
6 | 1. **Zero Configuration:** Parcel eliminates the need for complex configuration files (e.g., Webpack config) to set up your project. It automatically detects and configures most project settings, making it easy to get started.
7 |
8 | 2. **Fast Build Times:** Parcel is known for its fast build times, thanks to its intelligent caching and parallel processing. It optimizes the build process for speed and efficiency.
9 |
10 | 3. **Dependency Resolution:** Parcel automatically resolves and bundles all dependencies, including JavaScript, CSS, HTML, and more. It supports CommonJS, ES6, and other module systems.
11 |
12 | 4. **Support for Various Asset Types:** Parcel supports a wide range of asset types, including JavaScript, CSS, HTML, images, fonts, and more. It can process these assets and bundle them into an optimized package for deployment.
13 |
14 | 5. **Hot Module Replacement (HMR):** Parcel offers Hot Module Replacement, enabling you to see live updates in the browser as you make changes to your code without requiring a full page reload.
15 |
16 | 6. **Built-in Code Splitting:** Parcel provides built-in support for code splitting, allowing you to split your code into smaller, more manageable chunks that are loaded on demand.
17 |
18 | 7. **Cross-Browser Support:** Parcel ensures that the bundled output works across different browsers by handling browser compatibility and polyfills.
19 |
20 | 8. **Integration with Build Tools:** While Parcel is designed to be a zero-configuration bundler, it can still be extended and customized if needed, making it flexible enough to fit into various build toolchains.
21 |
22 | Overall, Parcel is a powerful and developer-friendly bundler that simplifies the build process and allows developers to focus more on writing code and less on configuring and setting up the build system. It's widely used in modern web development due to its ease of use and fast build times.
23 |
--------------------------------------------------------------------------------
/E03_foundation/notes/foundation.md:
--------------------------------------------------------------------------------
1 | # Component
2 |
3 | # Component Composition
4 |
--------------------------------------------------------------------------------
/E03_foundation/practical/App.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 |
4 | // Component using arrow function
5 | const App = () => {
6 | return (
7 |
23 | >
24 | )
25 | }
26 | }
27 |
28 | export default OrderHistory;
29 |
--------------------------------------------------------------------------------
/E09_optimization/practical/src/utils/hooks/index.js:
--------------------------------------------------------------------------------
1 | export { default as useOnlineStatus } from './useOnlineStatus';
2 |
3 |
--------------------------------------------------------------------------------
/E09_optimization/practical/src/utils/hooks/useOnlineStatus.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | const useOnlineStatus = () => {
4 | const [onlineStatus, setOnlineStatus] = useState(true);
5 | useEffect(() => {
6 | window.addEventListener('online', () => {
7 | setOnlineStatus(true)
8 | });
9 | window.addEventListener('offline', () => {
10 | setOnlineStatus(false)
11 | });
12 | }, [])
13 | return onlineStatus;
14 | }
15 |
16 | export default useOnlineStatus;
17 |
--------------------------------------------------------------------------------
/E10_tailwind/notes/note.md:
--------------------------------------------------------------------------------
1 | # Tailwind CSS ()
2 |
3 | Tailwind CSS is a popular utility-first CSS framework that aims to make it easier to build modern and responsive web interfaces. It provides a set of pre-defined utility classes that you can apply directly to HTML elements to style your website. Here are some key points about Tailwind CSS:
4 |
5 | Utility-First Approach: Tailwind CSS is known for its utility-first approach, where you create your user interface by applying pre-defined utility classes directly in your HTML markup. This approach allows you to rapidly build and customize your designs without writing custom CSS.
6 |
7 | Extensible: While Tailwind CSS provides a comprehensive set of utility classes out of the box, it's highly extensible. You can customize the framework to add your own utility classes or modify existing ones to match your project's needs.
8 |
9 | Responsive Design: Tailwind CSS makes it easy to create responsive designs by using classes like md:flex or lg:text-xl to control the layout and typography at different screen sizes.
10 |
11 | Community and Ecosystem: Tailwind CSS has a large and active community that shares plugins, extensions, and templates. You can easily find pre-built components and templates to accelerate your development.
12 |
13 | Readability: The utility classes in Tailwind CSS are designed to be human-readable and descriptive. This makes it easier for developers to understand and maintain the code.
14 |
15 | Performance: Tailwind CSS is designed to generate minimal CSS output by default. This can lead to better performance compared to traditional CSS frameworks with larger, less-specific stylesheets.
16 |
17 | Dark Mode: Tailwind CSS includes built-in support for dark mode, making it easier to create interfaces that adapt to users' preferences.
18 |
19 | Build Process: While Tailwind CSS can be used directly in HTML without a build process, it's often integrated with build tools like PostCSS to enable features like tree shaking, purging unused CSS, and more.
20 |
21 | Here's a simple example of how you can use Tailwind CSS classes in HTML:
22 |
23 | ```HTML
24 |
25 |
Welcome to Tailwind CSS
26 |
A utility-first CSS framework for building modern web applications.
27 |
28 |
29 | ```
30 |
31 | In this example, we've applied Tailwind CSS classes to style a simple div element with a blue background, white text, padding, and typography.
32 |
33 | Tailwind CSS is a versatile framework that can be used for a wide range of web development projects, from small websites to large-scale applications. Its flexibility and focus on developer productivity have made it a popular choice among web developers.
34 |
--------------------------------------------------------------------------------
/E10_tailwind/practical/.postcssrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": {
3 | "tailwindcss": {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/E10_tailwind/practical/README.md:
--------------------------------------------------------------------------------
1 | # namaste-react 🚀
2 | Episode by episode coding practice of Namaste React Course By Akashy Saini.
3 |
--------------------------------------------------------------------------------
/E10_tailwind/practical/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Namaste React
8 |
9 |
13 |
14 |
15 |
19 |
20 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/E10_tailwind/practical/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "namaste-react",
3 | "version": "1.0.0",
4 | "description": "",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1",
7 | "start": "parcel index.html",
8 | "build": "parcel build index.html"
9 | },
10 | "keywords": [
11 | "react",
12 | "namaste",
13 | "react"
14 | ],
15 | "author": "Neeraj Singh",
16 | "license": "ISC",
17 | "devDependencies": {
18 | "parcel": "^2.9.3",
19 | "postcss": "^8.4.29",
20 | "process": "^0.11.10",
21 | "tailwindcss": "^3.3.3"
22 | },
23 | "dependencies": {
24 | "react": "^18.2.0",
25 | "react-dom": "^18.2.0",
26 | "react-router-dom": "^6.15.0"
27 | },
28 | "browserlist": [
29 | "last 2 version"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/E10_tailwind/practical/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | const Footer = () => {
2 | return (
3 |
23 | >
24 | )
25 | }
26 | }
27 |
28 | export default OrderHistory;
29 |
--------------------------------------------------------------------------------
/E11_data/practical/src/data/UserContext.js:
--------------------------------------------------------------------------------
1 | import { createContext } from 'react'
2 |
3 | const UserContext = createContext({
4 | loggedUser: ' Neeraj'
5 | });
6 |
7 | export default UserContext;
8 |
--------------------------------------------------------------------------------
/E11_data/practical/src/utils/constants/index.js:
--------------------------------------------------------------------------------
1 | export const BASE_URL = 'http://localhost:1234';
2 |
--------------------------------------------------------------------------------
/E11_data/practical/src/utils/hooks/index.js:
--------------------------------------------------------------------------------
1 | export { default as useOnlineStatus } from './useOnlineStatus';
2 |
3 |
--------------------------------------------------------------------------------
/E11_data/practical/src/utils/hooks/useOnlineStatus.js:
--------------------------------------------------------------------------------
1 | import { useState, useEffect } from "react";
2 |
3 | const useOnlineStatus = () => {
4 | const [onlineStatus, setOnlineStatus] = useState(true);
5 | useEffect(() => {
6 | window.addEventListener('online', () => {
7 | setOnlineStatus(true)
8 | });
9 | window.addEventListener('offline', () => {
10 | setOnlineStatus(false)
11 | });
12 | }, [])
13 | return onlineStatus;
14 | }
15 |
16 | export default useOnlineStatus;
17 |
--------------------------------------------------------------------------------
/E11_data/practical/tailwind.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('tailwindcss').Config} */
2 | module.exports = {
3 | content: [
4 | "./src/**/*.{html,js,ts,jsx,tsx}",
5 | ],
6 | theme: {
7 | extend: {},
8 | },
9 | plugins: [],
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/E11_data/practical/tailwind.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/E12_redux/notes/reduxVersionHistory.md:
--------------------------------------------------------------------------------
1 | Redux has gone through several versions and iterations since its initial release. Here's a brief version history of Redux, highlighting some key improvements and changes:
2 |
3 | 1. **Redux 1.0.0** (June 2, 2015):
4 |
5 | - Initial release.
6 | - Introduced core concepts like actions, reducers, and the Redux store.
7 | - Provided a centralized state management solution for React applications.
8 |
9 | 2. **Redux 2.0.0** (August 30, 2015):
10 |
11 | - A minor release with various improvements and bug fixes.
12 |
13 | 3. **Redux 3.0.0** (April 13, 2016):
14 |
15 | - Major release with the introduction of Redux's "Ducks" pattern.
16 | - Improved error messages.
17 | - Support for TypeScript.
18 |
19 | 4. **Redux 3.3.0** (May 19, 2016):
20 |
21 | - Introduced the `redux-thunk` middleware for handling asynchronous actions.
22 |
23 | 5. **Redux 4.0.0** (October 27, 2017):
24 |
25 | - Major release with a rewrite of the internals to improve performance.
26 | - Added the `createContext` and `useSelector` hooks for React integration.
27 | - Removed the need for explicit root reducer combination.
28 |
29 | 6. **Redux Toolkit (RTK)** (July 20, 2020):
30 |
31 | - Redux Toolkit was introduced as an official package.
32 | - It provided a set of utilities to simplify common Redux patterns.
33 | - Included the `createSlice` function for creating reducers, actions, and selectors in a more concise way.
34 | - Encouraged the use of normalized state structures.
35 |
36 | 7. **Redux Toolkit 1.5.0** (August 28, 2020):
37 |
38 | - Introduced the `createAsyncThunk` utility for handling async actions.
39 | - Improved TypeScript support.
40 |
41 | 8. **Redux Toolkit 1.6.0** (October 16, 2020):
42 |
43 | - Introduced `createEntityAdapter` for managing normalized data.
44 | - Enhanced TypeScript support.
45 |
46 | 9. **Redux Toolkit 1.7.0** (January 12, 2021):
47 |
48 | - Added support for dynamic slices using the `createSlice` function.
49 |
50 | 10. **Redux Toolkit 1.8.0** (March 24, 2021):
51 |
52 | - Introduced the `configureStore` function for store configuration.
53 |
54 | 11. **Redux Toolkit 1.9.0** (June 23, 2021):
55 | - Added `redux-starter-kit` as a deprecated alias for `@reduxjs/toolkit`.
56 |
57 | Please note that these are just key versions and highlights. Redux continues to evolve with regular updates and improvements. It's a good practice to always check the official Redux documentation and release notes for the most up-to-date information and best practices.
58 |
--------------------------------------------------------------------------------
/E12_redux/practical/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /dist
3 | .parcel-cache
4 |
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/E12_redux/practical/.postcssrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": {
3 | "tailwindcss": {}
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/E12_redux/practical/README.md:
--------------------------------------------------------------------------------
1 | # namaste-react 🚀
2 | Episode by episode coding practice of Namaste React Course By Akashy Saini.
3 |
--------------------------------------------------------------------------------
/E12_redux/practical/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Namaste React
8 |
9 |
13 |
19 |
20 |
21 |
25 |
26 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/E12_redux/practical/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "namaste-react",
3 | "version": "1.0.0",
4 | "description": "",
5 | "scripts": {
6 | "test": "echo \"Error: no test specified\" && exit 1",
7 | "start": "parcel index.html",
8 | "build": "parcel build index.html"
9 | },
10 | "keywords": [
11 | "react",
12 | "namaste",
13 | "react"
14 | ],
15 | "author": "Neeraj Singh",
16 | "license": "ISC",
17 | "devDependencies": {
18 | "parcel": "^2.9.3",
19 | "postcss": "^8.4.29",
20 | "process": "^0.11.10",
21 | "tailwindcss": "^3.3.3"
22 | },
23 | "dependencies": {
24 | "@reduxjs/toolkit": "^1.9.5",
25 | "react": "^18.2.0",
26 | "react-dom": "^18.2.0",
27 | "react-redux": "^8.1.2",
28 | "react-router-dom": "^6.15.0"
29 | },
30 | "browserlist": [
31 | "last 2 version"
32 | ]
33 | }
34 |
--------------------------------------------------------------------------------
/E12_redux/practical/reactVersionHistory.md:
--------------------------------------------------------------------------------
1 | React, the JavaScript library for building user interfaces, has gone through several versions since its initial release. Here's a brief version history of React, highlighting some key improvements and changes:
2 |
3 | 1. **React 0.3.0** (May 29, 2013):
4 |
5 | - Initial public release.
6 | - Introduced the concept of components and a virtual DOM.
7 |
8 | 2. **React 0.4.0** (June 21, 2013):
9 |
10 | - Improved server-side rendering (SSR) support.
11 | - Introduced the `React.createClass` method for creating components.
12 |
13 | 3. **React 0.5.0** (July 18, 2013):
14 |
15 | - Improved performance.
16 | - Introduced `propTypes` for specifying component prop types.
17 |
18 | 4. **React 0.8.0** (August 12, 2013):
19 |
20 | - Added the ability to use custom HTML attributes in JSX.
21 |
22 | 5. **React 0.9.0** (September 2, 2013):
23 |
24 | - Introduced React Mixins for code reuse.
25 |
26 | 6. **React 0.10.0** (September 23, 2013):
27 |
28 | - Improved error handling and warnings.
29 | - Deprecated `React.autoBind`.
30 |
31 | 7. **React 0.11.0** (October 29, 2013):
32 |
33 | - Introduced `React.render` as a replacement for `React.renderComponent`.
34 |
35 | 8. **React 0.12.0** (November 18, 2014):
36 |
37 | - Introduced the concept of "React components" as classes with ES6 syntax.
38 | - Removed `React.autoBind`.
39 |
40 | 9. **React 0.13.0** (March 10, 2015):
41 |
42 | - Introduced Stateless Functional Components (SFC).
43 | - Deprecated some lifecycle methods in favor of new ones.
44 |
45 | 10. **React 0.14.0** (October 7, 2015):
46 |
47 | - Introduced the official React component library called "React Native" for building mobile apps.
48 | - Introduced the concept of "PureRenderMixin" for optimizing component rendering.
49 |
50 | 11. **React 15.0.0** (April 7, 2016):
51 |
52 | - React components no longer needed to be wrapped in a top-level element (e.g., `
`).
53 | - Improved performance and warnings.
54 | - React Native became an independent project.
55 |
56 | 12. **React 16.0.0** (September 26, 2017):
57 |
58 | - Introduced the Fiber architecture for improved performance and asynchronous rendering.
59 | - Added support for returning arrays and strings from render methods.
60 | - Improved error handling and warnings.
61 |
62 | 13. **React 16.3.0** (March 29, 2018):
63 |
64 | - Introduced the Context API for state management and prop drilling.
65 | - Deprecated some lifecycle methods in favor of new ones.
66 |
67 | 14. **React 16.8.0** (February 6, 2019):
68 |
69 | - Introduced Hooks, which allow functional components to manage state and side effects.
70 | - Made it easier to reuse stateful logic across components.
71 |
72 | 15. **React 17.0.0** (October 20, 2020):
73 |
74 | - Introduced no new features but focused on improving compatibility and providing a smooth upgrade path.
75 | - Laid the groundwork for concurrent mode.
76 |
77 | 16. **React 18 (Work in Progress)**:
78 | - Currently under development, React 18 is expected to bring improvements in concurrent mode, new features, and performance enhancements.
79 |
80 | Please note that these are just key versions and highlights. React continues to evolve with regular updates and improvements. It's essential to check the official React documentation and release notes for the most up-to-date information and best practices.
81 |
--------------------------------------------------------------------------------
/E12_redux/practical/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | const Footer = () => {
2 | return (
3 |
`).
53 | - Improved performance and warnings.
54 | - React Native became an independent project.
55 |
56 | 12. **React 16.0.0** (September 26, 2017):
57 |
58 | - Introduced the Fiber architecture for improved performance and asynchronous rendering.
59 | - Added support for returning arrays and strings from render methods.
60 | - Improved error handling and warnings.
61 |
62 | 13. **React 16.3.0** (March 29, 2018):
63 |
64 | - Introduced the Context API for state management and prop drilling.
65 | - Deprecated some lifecycle methods in favor of new ones.
66 |
67 | 14. **React 16.8.0** (February 6, 2019):
68 |
69 | - Introduced Hooks, which allow functional components to manage state and side effects.
70 | - Made it easier to reuse stateful logic across components.
71 |
72 | 15. **React 17.0.0** (October 20, 2020):
73 |
74 | - Introduced no new features but focused on improving compatibility and providing a smooth upgrade path.
75 | - Laid the groundwork for concurrent mode.
76 |
77 | 16. **React 18 (Work in Progress)**:
78 | - Currently under development, React 18 is expected to bring improvements in concurrent mode, new features, and performance enhancements.
79 |
80 | Please note that these are just key versions and highlights. React continues to evolve with regular updates and improvements. It's essential to check the official React documentation and release notes for the most up-to-date information and best practices.
81 |
--------------------------------------------------------------------------------
/E13_testing/practical/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | const Footer = () => {
2 | return (
3 |
`).
53 | - Improved performance and warnings.
54 | - React Native became an independent project.
55 |
56 | 12. **React 16.0.0** (September 26, 2017):
57 |
58 | - Introduced the Fiber architecture for improved performance and asynchronous rendering.
59 | - Added support for returning arrays and strings from render methods.
60 | - Improved error handling and warnings.
61 |
62 | 13. **React 16.3.0** (March 29, 2018):
63 |
64 | - Introduced the Context API for state management and prop drilling.
65 | - Deprecated some lifecycle methods in favor of new ones.
66 |
67 | 14. **React 16.8.0** (February 6, 2019):
68 |
69 | - Introduced Hooks, which allow functional components to manage state and side effects.
70 | - Made it easier to reuse stateful logic across components.
71 |
72 | 15. **React 17.0.0** (October 20, 2020):
73 |
74 | - Introduced no new features but focused on improving compatibility and providing a smooth upgrade path.
75 | - Laid the groundwork for concurrent mode.
76 |
77 | 16. **React 18 (Work in Progress)**:
78 | - Currently under development, React 18 is expected to bring improvements in concurrent mode, new features, and performance enhancements.
79 |
80 | Please note that these are just key versions and highlights. React continues to evolve with regular updates and improvements. It's essential to check the official React documentation and release notes for the most up-to-date information and best practices.
81 |
--------------------------------------------------------------------------------
/src/components/Footer.js:
--------------------------------------------------------------------------------
1 | const Footer = () => {
2 | return (
3 |