├── .gitignore ├── 01-why-react ├── README.md ├── banner.png ├── js-counter │ ├── counter.css │ ├── counter.html │ └── counter.js └── react-counter │ ├── counter.css │ └── counter.jsx ├── 02-code-environment ├── README.md ├── banner.png ├── first-project │ ├── .gitignore │ ├── README.md │ ├── eslint.config.js │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.jsx │ │ ├── Banner.jsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── index.css │ │ └── main.jsx │ ├── tailwind.config.js │ ├── vite.config.js │ └── yarn.lock └── task.md ├── 03-thinking-in-react ├── README.md ├── banner.png ├── boimela │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── boimela.png │ ├── broken-in-components.png │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.jsx │ │ ├── Boimela.jsx │ │ ├── BookDetails.jsx │ │ ├── BookList.jsx │ │ ├── BookRow.jsx │ │ ├── FeatureBook.jsx │ │ ├── Header.jsx │ │ ├── SearchBar.jsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── index.css │ │ └── main.jsx │ ├── tailwind.config.js │ ├── vite.config.js │ └── yarn.lock ├── cars.png └── task.md ├── 04-identify-state-props ├── README.md ├── banner.png ├── boimela │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── boimela.png │ ├── broken-in-components.png │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.jsx │ │ ├── Boimela.jsx │ │ ├── BookDetails.jsx │ │ ├── BookList.jsx │ │ ├── BookRow.jsx │ │ ├── FeatureBook.jsx │ │ ├── Header.jsx │ │ ├── SearchBar.jsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── index.css │ │ └── main.jsx │ ├── tailwind.config.js │ ├── vite.config.js │ └── yarn.lock └── task.md ├── 05-mastering-jsx ├── README.md ├── banner.png ├── learning-jsx │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── Avatar.jsx │ │ ├── Items.jsx │ │ ├── Post.jsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── index.css │ │ └── main.jsx │ ├── tailwind.config.js │ ├── tapascript.html │ ├── vite.config.js │ └── yarn.lock └── task.md ├── 08-event-handling ├── README.md ├── banner.png └── learn-event-handling │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ └── vite.svg │ ├── src │ ├── App.css │ ├── App.jsx │ ├── Button.jsx │ ├── CrazyButton.jsx │ ├── Navbar.jsx │ ├── Register.jsx │ ├── TextBox.jsx │ ├── ToolBar.jsx │ ├── assets │ │ └── react.svg │ ├── index.css │ └── main.jsx │ ├── vite.config.js │ └── yarn.lock ├── 09-array-object-immutability ├── README.md ├── banner.png ├── movie-watch │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ │ └── vite.svg │ ├── src │ │ ├── App.css │ │ ├── App.jsx │ │ ├── Filter.jsx │ │ ├── Heading.jsx │ │ ├── MovieForm.jsx │ │ ├── MovieItem.jsx │ │ ├── MovieList.jsx │ │ ├── MovieWatch.jsx │ │ ├── assets │ │ │ └── react.svg │ │ ├── immutability │ │ │ └── UserList.jsx │ │ ├── index.css │ │ └── main.jsx │ ├── vite.config.js │ └── yarn.lock └── task.md ├── 10-useEffect ├── README.md ├── banner.png ├── task.md └── useeffect-lesson │ ├── .eslintrc.cjs │ ├── .gitignore │ ├── README.md │ ├── index.html │ ├── package.json │ ├── postcss.config.js │ ├── public │ └── vite.svg │ ├── src │ ├── App.css │ ├── App.jsx │ ├── Basics.jsx │ ├── CleanupEffect.jsx │ ├── PropsChangeEffect.jsx │ ├── StateChangeEffect.jsx │ ├── assets │ │ └── react.svg │ ├── index.css │ └── main.jsx │ ├── vite.config.js │ └── yarn.lock └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | -------------------------------------------------------------------------------- /01-why-react/README.md: -------------------------------------------------------------------------------- 1 | # 01: Why React? 2 | 3 | Learn why to lear ReactJs in 2025 and how it is different than many others when it comes to building web and mobile applications. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | 14 | 15 | ## Video 16 | Here is the video for you to go through and learn: 17 | 18 | [![01-Why-React](./banner.png)](https://youtu.be/JSLTS3dfHKU "Video") -------------------------------------------------------------------------------- /01-why-react/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/01-why-react/banner.png -------------------------------------------------------------------------------- /01-why-react/js-counter/counter.css: -------------------------------------------------------------------------------- 1 | .counter { 2 | display: flex; 3 | align-items: center; 4 | gap: 10px; 5 | margin-bottom: 10px; 6 | } 7 | button { 8 | padding: 5px 10px; 9 | border: none; 10 | background-color: #007bff; 11 | color: white; 12 | border-radius: 3px; 13 | cursor: pointer; 14 | } 15 | button:hover { 16 | background-color: #0056b3; 17 | } 18 | span { 19 | font-size: 16px; 20 | font-weight: bold; 21 | } 22 | -------------------------------------------------------------------------------- /01-why-react/js-counter/counter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Counters 8 | 9 | 10 | 11 | 12 |

Counter

13 |
14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /01-why-react/js-counter/counter.js: -------------------------------------------------------------------------------- 1 | function createCounter(container) { 2 | const counterDiv = document.createElement("div"); 3 | counterDiv.className = "counter"; 4 | 5 | let count = 0; 6 | 7 | const countDisplay = document.createElement("span"); 8 | countDisplay.textContent = count; 9 | 10 | const incrementButton = document.createElement("button"); 11 | incrementButton.textContent = "Increment"; 12 | incrementButton.addEventListener("click", () => { 13 | count++; 14 | countDisplay.textContent = count; 15 | }); 16 | 17 | const decrementButton = document.createElement("button"); 18 | decrementButton.textContent = "Decrement"; 19 | decrementButton.addEventListener("click", () => { 20 | count--; 21 | countDisplay.textContent = count; 22 | }); 23 | 24 | counterDiv.appendChild(decrementButton); 25 | counterDiv.appendChild(countDisplay); 26 | counterDiv.appendChild(incrementButton); 27 | 28 | container.appendChild(counterDiv); 29 | } 30 | 31 | // Create multiple counters 32 | const countersContainer = document.getElementById("counters"); 33 | for (let i = 0; i < 5; i++) { 34 | createCounter(countersContainer); 35 | } 36 | -------------------------------------------------------------------------------- /01-why-react/react-counter/counter.css: -------------------------------------------------------------------------------- 1 | .counter { 2 | display: flex; 3 | align-items: center; 4 | gap: 10px; 5 | margin-bottom: 10px; 6 | } 7 | button { 8 | padding: 5px 10px; 9 | border: none; 10 | background-color: #007bff; 11 | color: white; 12 | border-radius: 3px; 13 | cursor: pointer; 14 | } 15 | button:hover { 16 | background-color: #0056b3; 17 | } 18 | span { 19 | font-size: 16px; 20 | font-weight: bold; 21 | } 22 | -------------------------------------------------------------------------------- /01-why-react/react-counter/counter.jsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import "./counter.css"; 3 | 4 | function Counter() { 5 | const [count, setCount] = React.useState(0); 6 | 7 | return ( 8 |
9 | 10 | {count} 11 | 12 |
13 | ); 14 | } 15 | 16 | function App() { 17 | return ( 18 |
19 |

Counters

20 | 21 | 22 | 23 |
24 | ); 25 | } 26 | 27 | export default App; 28 | -------------------------------------------------------------------------------- /02-code-environment/README.md: -------------------------------------------------------------------------------- 1 | # 02: Code Environment 2 | 3 | Learn why to lear ReactJs in 2025 and how it is different than many others when it comes to building web and mobile applications. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | 14 | 15 | ## Video 16 | Here is the video for you to go through and learn: 17 | 18 | [![02-code-env](./banner.png)](https://youtu.be/9PZ4uymTAz0 "Video") -------------------------------------------------------------------------------- /02-code-environment/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/02-code-environment/banner.png -------------------------------------------------------------------------------- /02-code-environment/first-project/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /02-code-environment/first-project/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /02-code-environment/first-project/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import react from 'eslint-plugin-react' 4 | import reactHooks from 'eslint-plugin-react-hooks' 5 | import reactRefresh from 'eslint-plugin-react-refresh' 6 | 7 | export default [ 8 | { ignores: ['dist'] }, 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | languageOptions: { 12 | ecmaVersion: 2020, 13 | globals: globals.browser, 14 | parserOptions: { 15 | ecmaVersion: 'latest', 16 | ecmaFeatures: { jsx: true }, 17 | sourceType: 'module', 18 | }, 19 | }, 20 | settings: { react: { version: '18.3' } }, 21 | plugins: { 22 | react, 23 | 'react-hooks': reactHooks, 24 | 'react-refresh': reactRefresh, 25 | }, 26 | rules: { 27 | ...js.configs.recommended.rules, 28 | ...react.configs.recommended.rules, 29 | ...react.configs['jsx-runtime'].rules, 30 | ...reactHooks.configs.recommended.rules, 31 | 'react/jsx-no-target-blank': 'off', 32 | 'react-refresh/only-export-components': [ 33 | 'warn', 34 | { allowConstantExport: true }, 35 | ], 36 | }, 37 | }, 38 | ] 39 | -------------------------------------------------------------------------------- /02-code-environment/first-project/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /02-code-environment/first-project/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "first-project", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "19.0.0", 14 | "react-dom": "19.0.0" 15 | }, 16 | "devDependencies": { 17 | "@eslint/js": "^9.17.0", 18 | "@types/react": "^18.3.18", 19 | "@types/react-dom": "^18.3.5", 20 | "@vitejs/plugin-react": "^4.3.4", 21 | "autoprefixer": "^10.4.20", 22 | "eslint": "^9.17.0", 23 | "eslint-plugin-react": "^7.37.2", 24 | "eslint-plugin-react-hooks": "^5.0.0", 25 | "eslint-plugin-react-refresh": "^0.4.16", 26 | "globals": "^15.14.0", 27 | "postcss": "^8.4.49", 28 | "tailwindcss": "^3.4.17", 29 | "vite": "^6.0.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /02-code-environment/first-project/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /02-code-environment/first-project/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02-code-environment/first-project/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Banner from "./Banner" 2 | 3 | function App() { 4 | return ( 5 | <> 6 |

7 | Hello world! 8 |

9 | 10 | 11 | ) 12 | } 13 | 14 | export default App 15 | -------------------------------------------------------------------------------- /02-code-environment/first-project/src/Banner.jsx: -------------------------------------------------------------------------------- 1 | 2 | function Banner() { 3 | return ( 4 |
Banner
5 | ) 6 | } 7 | 8 | export default Banner -------------------------------------------------------------------------------- /02-code-environment/first-project/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /02-code-environment/first-project/src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /02-code-environment/first-project/src/main.jsx: -------------------------------------------------------------------------------- 1 | import { StrictMode } from 'react' 2 | import { createRoot } from 'react-dom/client' 3 | import './index.css' 4 | import App from './App.jsx' 5 | 6 | createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /02-code-environment/first-project/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | 13 | -------------------------------------------------------------------------------- /02-code-environment/first-project/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vite.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /02-code-environment/task.md: -------------------------------------------------------------------------------- 1 | 2 | - [ ] Task 3 | - [ ] Setup a React Project with Vite from the Scratch 4 | - [ ] Add TailwindCSS to your project 5 | - [ ] Create a Component that prints `We are here to learn React from tapaScript" 6 | - [ ] Make the text XL size, Green Color, Center Aligned, With a Background Color, A bit of padding. 7 | - [ ] Deploy the App to Netlify/Vercel/Render 8 | - [ ] Share the Deployed App Link and the screenshot of your app on Discord’s `task-discussion` channel. Try to put everything in a single comment. -------------------------------------------------------------------------------- /03-thinking-in-react/README.md: -------------------------------------------------------------------------------- 1 | # 03 - Thinking In React 2 | 3 | Thinking in React implies: 4 | 5 | - How you think of components. 6 | - How you identify states. 7 | - How you decide of the data flow. 8 | 9 | ## 🫶 Support 10 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 11 | 12 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 13 | 14 | ### 🤝 Sponsor My Work 15 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 16 | 17 | ## The Video Tutorial 18 | In this video tutorial, we have developed a UI design with the "Thinking in React" mindset. 19 | 20 | Here is the video for you to go through and learn: 21 | 22 | [![03-think-in-react-component](./banner.png)](https://youtu.be/Byy41AxCK88 "Video") 23 | 24 | ### The UI We Developed 25 | 26 | > ![boimela](./boimela/boimela.png) 27 | *The UI Design* 28 | 29 | ## Tasks 30 | Please complete these tasks. Refer to the video tutorial above to learn. 31 | 32 | - [Tasks](./task.md) 33 | 34 | -------------------------------------------------------------------------------- /03-thinking-in-react/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/03-thinking-in-react/banner.png -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 10 | 11 | ## Run it Locally 12 | 13 | - Clone or fork the repo 14 | - Install dependencies using `npm install` or `yarn install` 15 | - Run it using `npm run dev` or `yarn dev` 16 | 17 | The app will be available on `http://localhost:5173` by default. 18 | 19 | ## 🫶 Support 20 | Liked it? You can show your support with a STAR(⭐). 21 | 22 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 23 | 24 | ### Sponsor My Work 25 | 26 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 27 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/boimela.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/03-thinking-in-react/boimela/boimela.png -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/broken-in-components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/03-thinking-in-react/boimela/broken-in-components.png -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | tapaScript Boimela 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "lucide-react": "^0.471.0", 14 | "react": "^19.0.0", 15 | "react-dom": "^19.0.0", 16 | "react-error-boundary": "^4.0.13" 17 | }, 18 | "devDependencies": { 19 | "@types/react": "npm:types-react@rc", 20 | "@types/react-dom": "npm:types-react-dom@rc", 21 | "@vitejs/plugin-react": "^4.2.1", 22 | "autoprefixer": "^10.4.19", 23 | "eslint": "^8.57.0", 24 | "eslint-plugin-react": "^7.34.1", 25 | "eslint-plugin-react-hooks": "^4.6.0", 26 | "eslint-plugin-react-refresh": "^0.4.6", 27 | "postcss": "^8.4.38", 28 | "tailwindcss": "^3.4.3", 29 | "vite": "^5.2.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Boimela from "./Boimela"; 2 | 3 | function App() { 4 | return ; 5 | } 6 | 7 | export default App; 8 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/Boimela.jsx: -------------------------------------------------------------------------------- 1 | import Header from "./Header"; 2 | import SearchBar from "./SearchBar"; 3 | import BookList from "./BookList"; 4 | 5 | export default function Boimela() { 6 | return ( 7 |
8 |
9 | 10 | 11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/BookDetails.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | function BookDetails({ title, author }) { 4 | return ( 5 |
6 |

{title}

7 |

{author}

8 |
9 | ); 10 | } 11 | 12 | BookDetails.propTypes = { 13 | title: PropTypes.string.isRequired, 14 | author: PropTypes.string.isRequired, 15 | }; 16 | 17 | export default BookDetails; 18 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/BookList.jsx: -------------------------------------------------------------------------------- 1 | import BookRow from "./BookRow"; 2 | // Mock data for books 3 | const BOOKS = [ 4 | { 5 | id: 1, 6 | title: "To Kill a Mockingbird", 7 | author: "Harper Lee", 8 | featured: false, 9 | }, 10 | { id: 2, title: "1984", author: "George Orwell", featured: false }, 11 | { 12 | id: 3, 13 | title: "The Great Gatsby", 14 | author: "F. Scott Fitzgerald", 15 | featured: false, 16 | }, 17 | { 18 | id: 4, 19 | title: "Pride and Prejudice", 20 | author: "Jane Austen", 21 | featured: false, 22 | }, 23 | { 24 | id: 5, 25 | title: "The Catcher in the Rye", 26 | author: "J.D. Salinger", 27 | featured: false, 28 | }, 29 | ]; 30 | 31 | function BookList() { 32 | return ( 33 | 43 | ); 44 | } 45 | 46 | export default BookList; 47 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/BookRow.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | import BookDetails from "./BookDetails"; 4 | import FeatureBook from "./FeatureBook"; 5 | 6 | function BookRow({ book }) { 7 | console.log(book); 8 | return ( 9 | <> 10 | 11 | 12 | 13 | ); 14 | } 15 | 16 | BookRow.propTypes = { 17 | book: PropTypes.object.isRequired, 18 | }; 19 | 20 | export default BookRow; 21 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/FeatureBook.jsx: -------------------------------------------------------------------------------- 1 | import { Star } from "lucide-react"; 2 | 3 | function FeatureBook() { 4 | return ; 5 | } 6 | 7 | export default FeatureBook; 8 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/Header.jsx: -------------------------------------------------------------------------------- 1 | export default function Header() { 2 | return ( 3 |
4 |

Boimela

5 |
6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/SearchBar.jsx: -------------------------------------------------------------------------------- 1 | function SearchBar() { 2 | return ( 3 | 8 | ); 9 | } 10 | 11 | export default SearchBar; 12 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | 13 | -------------------------------------------------------------------------------- /03-thinking-in-react/boimela/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /03-thinking-in-react/cars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/03-thinking-in-react/cars.png -------------------------------------------------------------------------------- /03-thinking-in-react/task.md: -------------------------------------------------------------------------------- 1 | Complete this task to show that you can now think in react. 2 | 3 | ## Tasks 4 | - Study this user interface design very well. 5 | > ![tapaScript Cars](cars.png) 6 | - Break this design into the logical structure of components as you have learned in the video lesson. 7 | - Create a Component Hierarchy Diagram using excalidraw or any other tool of your choice. 8 | - Create the Components and compose them to align with the above hierarchy. Here is the JSON data to use: 9 | ```js 10 | [ 11 | { id: 1, title: "Luxury Sedan", brand: "Mercedes", year: 2023, price: 80000, isPremium: true }, 12 | { id: 2, title: "Family SUV", brand: "Toyota", year: 2022, price: 45000, isPremium: false }, 13 | { id: 3, title: "Sports Car", brand: "Porsche", year: 2023, price: 120000, isPremium: true }, 14 | { id: 4, title: "Electric Hatchback", brand: "Nissan", year: 2022, price: 35000, isPremium: false }, 15 | { id: 5, title: "Luxury SUV", brand: "BMW", year: 2023, price: 90000, isPremium: true }, 16 | ] 17 | ``` 18 | - Match the component hierarchy in the React Dev Tool 19 | - Now use TailwindCSS to style the components to match the user interface design. 20 | - Make sure your code is well-formatted. 21 | - Make sure there is NO Eslint error or Eslint supression. 22 | - Make sure there are no console errors. 23 | - Push the project into GitHub. 24 | - Deploy the project on Netlify/Vercel/Render. 25 | - Write a good `Readme.md` file: 26 | - Explaining your project 27 | - How to run it 28 | - The screenshot of the UX design diagram 29 | - Component Breakdown diagram 30 | - Component Hierarchy diagram 31 | - React Dev Tools Screenshot 32 | - The Readme should have the deploy link of the app too. 33 | 34 | ## Share the folowings in the task channel of Discord 35 | Just Your project repository link with the `readme` explained above. -------------------------------------------------------------------------------- /04-identify-state-props/README.md: -------------------------------------------------------------------------------- 1 | # 04 - Identifying States and Props 2 | 3 | Identify the state and props with proper logic and formula. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | ## The Video Tutorial 14 | In this video tutorial, we have developed a UI design with the "Thinking in React" mindset. 15 | 16 | Here is the video for you to go through and learn: 17 | 18 | [![03-think-in-react-component](./banner.png)](https://youtu.be/oB2qBjMiDpE "Video") 19 | 20 | ## Tasks 21 | Please complete these tasks. Refer to the video tutorial above to learn. 22 | 23 | - [Tasks](./task.md) 24 | 25 | -------------------------------------------------------------------------------- /04-identify-state-props/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/04-identify-state-props/banner.png -------------------------------------------------------------------------------- /04-identify-state-props/boimela/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 10 | 11 | ## Run it Locally 12 | 13 | - Clone or fork the repo 14 | - Install dependencies using `npm install` or `yarn install` 15 | - Run it using `npm run dev` or `yarn dev` 16 | 17 | The app will be available on `http://localhost:5173` by default. 18 | 19 | ## 🫶 Support 20 | Liked it? You can show your support with a STAR(⭐). 21 | 22 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 23 | 24 | ### Sponsor My Work 25 | 26 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 27 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/boimela.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/04-identify-state-props/boimela/boimela.png -------------------------------------------------------------------------------- /04-identify-state-props/boimela/broken-in-components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/04-identify-state-props/boimela/broken-in-components.png -------------------------------------------------------------------------------- /04-identify-state-props/boimela/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | tapaScript Boimela 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "lucide-react": "^0.471.0", 14 | "react": "^19.0.0", 15 | "react-dom": "^19.0.0", 16 | "react-error-boundary": "^4.0.13" 17 | }, 18 | "devDependencies": { 19 | "@types/react": "npm:types-react@rc", 20 | "@types/react-dom": "npm:types-react-dom@rc", 21 | "@vitejs/plugin-react": "^4.2.1", 22 | "autoprefixer": "^10.4.19", 23 | "eslint": "^8.57.0", 24 | "eslint-plugin-react": "^7.34.1", 25 | "eslint-plugin-react-hooks": "^4.6.0", 26 | "eslint-plugin-react-refresh": "^0.4.6", 27 | "postcss": "^8.4.38", 28 | "tailwindcss": "^3.4.3", 29 | "vite": "^5.2.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Boimela from "./Boimela"; 2 | 3 | function App() { 4 | return ; 5 | } 6 | 7 | export default App; 8 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/Boimela.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import Header from "./Header"; 3 | import SearchBar from "./SearchBar"; 4 | import BookList from "./BookList"; 5 | 6 | export default function Boimela() { 7 | // Mock data for books 8 | const BOOKS = [ 9 | { 10 | id: 1, 11 | title: "To Kill a Mockingbird", 12 | author: "Harper Lee", 13 | featured: false, 14 | }, 15 | { id: 2, title: "1984", author: "George Orwell", featured: false }, 16 | { 17 | id: 3, 18 | title: "The Great Gatsby", 19 | author: "F. Scott Fitzgerald", 20 | featured: false, 21 | }, 22 | { 23 | id: 4, 24 | title: "Pride and Prejudice", 25 | author: "Jane Austen", 26 | featured: false, 27 | }, 28 | { 29 | id: 5, 30 | title: "The Catcher in the Rye", 31 | author: "J.D. Salinger", 32 | featured: false, 33 | }, 34 | ]; 35 | const [books, setBooks] = useState(BOOKS); 36 | const [searchTerm, setSearchTerm] = useState(""); 37 | 38 | console.log(books) 39 | 40 | const toggleFeatured = (id) => { 41 | setBooks( 42 | books.map((book) => 43 | book.id === id ? { ...book, featured: !book.featured } : book 44 | ) 45 | ); 46 | }; 47 | 48 | return ( 49 |
50 |
51 | 52 | 53 |
54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/BookDetails.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | function BookDetails({ title, author }) { 4 | return ( 5 |
6 |

{title}

7 |

{author}

8 |
9 | ); 10 | } 11 | 12 | BookDetails.propTypes = { 13 | title: PropTypes.string.isRequired, 14 | author: PropTypes.string.isRequired, 15 | }; 16 | 17 | export default BookDetails; 18 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/BookList.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | import BookRow from "./BookRow"; 3 | 4 | function BookList({ searchTerm, books, onFeatureBook }) { 5 | const rows = []; 6 | books.forEach((book) => { 7 | if (book.title.toLowerCase().indexOf(searchTerm.toLowerCase()) === -1) { 8 | return; 9 | } 10 | rows.push(); 11 | }); 12 | 13 | return
{rows}
; 14 | } 15 | BookList.propTypes = { 16 | books: PropTypes.arrayOf( 17 | PropTypes.shape({ 18 | id: PropTypes.number.isRequired, 19 | title: PropTypes.string.isRequired, 20 | author: PropTypes.string.isRequired, 21 | }) 22 | ).isRequired, 23 | searchTerm: PropTypes.string.isRequired, 24 | onFeatureBook: PropTypes.func.isRequired 25 | }; 26 | 27 | export default BookList; 28 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/BookRow.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | import BookDetails from "./BookDetails"; 4 | import FeatureBook from "./FeatureBook"; 5 | 6 | function BookRow({ book, onFeatureBook }) { 7 | return ( 8 |
9 | 10 | 11 |
12 | ); 13 | } 14 | 15 | BookRow.propTypes = { 16 | book: PropTypes.object.isRequired, 17 | onFeatureBook: PropTypes.func.isRequired 18 | }; 19 | 20 | export default BookRow; 21 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/FeatureBook.jsx: -------------------------------------------------------------------------------- 1 | import { Star } from "lucide-react"; 2 | import PropTypes from "prop-types"; 3 | 4 | function FeatureBook({ book, onFeatureBook }) { 5 | return ( 6 | 12 | ); 13 | } 14 | 15 | FeatureBook.propTypes = { 16 | book: PropTypes.object.isRequired, 17 | onFeatureBook: PropTypes.func.isRequired, 18 | }; 19 | 20 | export default FeatureBook; 21 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/Header.jsx: -------------------------------------------------------------------------------- 1 | export default function Header() { 2 | return ( 3 |
4 |

Boimela

5 |
6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/SearchBar.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | function SearchBar({ searchTerm, onSearchBook }) { 4 | return ( 5 |
6 | onSearchBook(event.target.value)} 11 | className="mb-4 border rounded-md p-1 w-full" 12 | /> 13 |
14 | ); 15 | } 16 | SearchBar.propTypes = { 17 | searchTerm: PropTypes.string.isRequired, 18 | onSearchBook: PropTypes.func.isRequired, 19 | }; 20 | 21 | export default SearchBar; 22 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /04-identify-state-props/boimela/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | 13 | -------------------------------------------------------------------------------- /04-identify-state-props/boimela/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /04-identify-state-props/task.md: -------------------------------------------------------------------------------- 1 | Complete this task to show that you can now think in react and identiofy the state and props easily. 2 | 3 | ## Tasks 4 | - Idenify the state and props in your last designed UI(tapaScript Cars). 5 | - First, do the design on top of the component hierarchy diagram. 6 | - Then Implement in code 7 | - Implement the Search and checkbox functionality with identified states and props. 8 | - Make sure your code is well-formatted. 9 | - Make sure there is NO Eslint error or Eslint supression. 10 | - Make sure there are no console errors. 11 | - Push the project into GitHub. 12 | - Deploy the project on Netlify/Vercel/Render. 13 | - Write a good `Readme.md` file: 14 | - Explaining your project 15 | - How to run it 16 | - Screenshot of the Component Hierarchy diagram 17 | - The Readme should have the deploy link of the app too. 18 | 19 | ## Share the folowings in the task channel of Discord 20 | Just Your project repository link with the `readme` explained above. -------------------------------------------------------------------------------- /05-mastering-jsx/README.md: -------------------------------------------------------------------------------- 1 | # 05 - Mastering JSX 2 | 3 | Master JSX and its Rules with Hands-on Coding. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | ## The Video Tutorial 14 | In this video tutorial, we have developed a UI design with the "Thinking in React" mindset. 15 | 16 | Here is the video for you to go through and learn: 17 | 18 | [![05-mastering-jsx](./banner.png)](https://www.youtube.com/watch?v=fPBW7Pn6O38&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=5 "Video") 19 | 20 | ## Tasks 21 | Please complete these tasks. Refer to the video tutorial above to learn. 22 | 23 | - [Tasks](./task.md) 24 | 25 | -------------------------------------------------------------------------------- /05-mastering-jsx/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/05-mastering-jsx/banner.png -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 10 | 11 | ## Create Your Own React 19 Project with Vite and TailwindCSS 12 | There are multiple ways you can utilize this repository to create your own project. The most straightforward way is by using the follwoing command from the command prompt/terminal: 13 | 14 | ```bash 15 | npx degit atapas/code-in-react-19#main 16 | ``` 17 | 18 | This will clone the repository to your project. Alternatively, you can fork this repo or create a new repo from the template by clicking on the button at the top-right corner. 19 | 20 | ## 🫶 Support 21 | Liked it? You can show your support with a STAR(⭐). 22 | 23 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 24 | 25 | ### Sponsor My Work 26 | 27 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 28 | 29 | ## Run it Locally 30 | 31 | - Clone or fork the repo 32 | - Install dependencies using `npm install` or `yarn install` 33 | - Run it using `npm run dev` or `yarn dev` 34 | 35 | The app will be available on `http://localhost:5173` by default. 36 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Learning JSX 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0", 15 | "react-error-boundary": "^4.0.13" 16 | }, 17 | "devDependencies": { 18 | "@types/react": "npm:types-react@rc", 19 | "@types/react-dom": "npm:types-react-dom@rc", 20 | "@vitejs/plugin-react": "^4.2.1", 21 | "autoprefixer": "^10.4.19", 22 | "eslint": "^8.57.0", 23 | "eslint-plugin-react": "^7.34.1", 24 | "eslint-plugin-react-hooks": "^4.6.0", 25 | "eslint-plugin-react-refresh": "^0.4.6", 26 | "postcss": "^8.4.38", 27 | "tailwindcss": "^3.4.3", 28 | "vite": "^5.2.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Avatar from "./Avatar"; 2 | import Items from "./Items"; 3 | import Post from "./Post"; 4 | function App() { 5 | return ( 6 | <> 7 | 8 | 9 | 10 | 11 | ); 12 | } 13 | 14 | export default App; 15 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/Avatar.jsx: -------------------------------------------------------------------------------- 1 | const Avatar = () => { 2 | const photoURL = 3 | "https://res.cloudinary.com/atapas/image/upload/v1721647736/youtube/logo/YT-800-D_-_Bangla_px6glg.png"; 4 | const description = "tapaScript বাংলা"; 5 | 6 | const height = "200px"; 7 | const width = "200px"; 8 | 9 | const today = new Date(); 10 | 11 | function getDay(date) { 12 | return new Intl.DateTimeFormat("en-US", { weekday: "long" }).format( 13 | date 14 | ); 15 | } 16 | 17 | const styleNames = { 18 | backgroundColor: "green", 19 | color: "black" 20 | } 21 | 22 | return ( 23 | <> 24 |

Today is {getDay(today)}

25 | 26 | {description} 32 | 33 | ); 34 | }; 35 | 36 | export default Avatar; 37 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/Items.jsx: -------------------------------------------------------------------------------- 1 | const Items = () => { 2 | const itemList = [ 3 | {"id": crypto.randomUUID() , "value":"test1234"}, 4 | {"id": crypto.randomUUID() , "value":"test"}, 5 | {"id": crypto.randomUUID() , "value":"Learn React like a Cake Walk"}, 6 | {"id": crypto.randomUUID() , "value":"Get Stronger in JavaScript"}, 7 | {"id": crypto.randomUUID() , "value":"Be Master of Problem Solving"}, 8 | 9 | ]; 10 | 11 | console.log(itemList) 12 | 13 | const items = []; 14 | itemList.forEach((item) => { 15 | const liItem =
  • {item.value}
  • ; 16 | items.push(liItem); 17 | }); 18 | 19 | console.log(items); 20 | return
      {items}
    ; 21 | }; 22 | 23 | export default Items; 24 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/Post.jsx: -------------------------------------------------------------------------------- 1 | import { Fragment } from "react"; 2 | 3 | const posts = [ 4 | { 5 | id: 1, 6 | title: "What is React?", 7 | description: "A Beautiful Library to create....", 8 | }, 9 | { 10 | id: 2, 11 | title: "What is Web Development?", 12 | description: "A development process through which...", 13 | }, 14 | ]; 15 | 16 | const Post = () => { 17 | return posts.map((post) => ( 18 | 19 |

    {post.title}

    20 |

    {post.description}

    21 |
    22 | )); 23 | }; 24 | 25 | export default Post; 26 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/index.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | export default { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{js,ts,jsx,tsx}", 6 | ], 7 | theme: { 8 | extend: {}, 9 | }, 10 | plugins: [], 11 | } 12 | 13 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/tapascript.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Document 8 | 9 | 10 | 11 |

    tapaScript

    12 | tapaScript বাংলা 13 |
      14 |
    • Learn React like a Cake Walk 15 |
    • Get Stronger in JavaScript 16 |
    • Be Master of Problem Solving 17 |
    18 | 19 | 20 | -------------------------------------------------------------------------------- /05-mastering-jsx/learning-jsx/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /05-mastering-jsx/task.md: -------------------------------------------------------------------------------- 1 | Complete this task to show that you understood JSX well. 2 | 3 | ## Tasks 4 | - Create a react project with Vite and TailwindCSS or use an existing project. 5 | - Create component(s) that list down a user from the user array(5 users) and prints the user's full name, age, occupation from the user array. Make sure to use a unique `key` as explained in the lesson. 6 | - Use the `Fragment` in the code. 7 | - Add a `+` icon at the top-right corner of the page. Everytime clicking on it, add a random user into the UI list that shows in the UI. Note: No UI to create to accept inputs to create this new user. Just use `Math.random()` along with some `Test user` name to create it. 8 | - Show the total user count somewhere at the top. It should be updated everytime you add a user. 9 | - First sketch the UI in Figma, or Exclaidraw, or draw.io, or any other tools like MS Paint. 10 | - Create the Component Breakdown Diagram 11 | - Create a Component Hierarchy diagram 12 | - Identify State and Props 13 | - Deploy the App publicly 14 | - Create a Readme file for the project and add the followings: 15 | - Your designed UI 16 | - All the Diagrams 17 | - How to run the project localy. 18 | - Deploy URL 19 | 20 | ## Share the folowings in the task channel of Discord 21 | Just Your project repository link with the `readme` mentioned above. -------------------------------------------------------------------------------- /08-event-handling/README.md: -------------------------------------------------------------------------------- 1 | # 08 - React Events 2 | 3 | Master Events and its Rules with Hands-on Coding. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | ## The Video Tutorial 14 | In this video tutorial, we have developed a UI design with the "Thinking in React" mindset. 15 | 16 | Here is the video for you to go through and learn: 17 | 18 | [![08-events](./banner.png)](https://www.youtube.com/watch?v=MHxltS0XXlU&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=9 "Video") 19 | 20 | 21 | -------------------------------------------------------------------------------- /08-event-handling/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/08-event-handling/banner.png -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 4.x 10 | 11 | ## Create Your Own React 19 Project with Vite and TailwindCSS 12 | There are multiple ways you can utilize this repository to create your own project. The most straightforward way is by using the follwoing command from the command prompt/terminal: 13 | 14 | ```bash 15 | npx degit atapas/code-in-react-19#main 16 | ``` 17 | 18 | This will clone the repository to your project. Alternatively, you can fork this repo or create a new repo from the template by clicking on the button at the top-right corner. 19 | 20 | ## 🫶 Support 21 | Liked it? You can show your support with a STAR(⭐). 22 | 23 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 24 | 25 | ### Sponsor My Work 26 | 27 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 28 | 29 | ## Run it Locally 30 | 31 | - Clone or fork the repo 32 | - Install dependencies using `npm install` or `yarn install` 33 | - Run it using `npm run dev` or `yarn dev` 34 | 35 | The app will be available on `http://localhost:5173` by default. 36 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
    11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0", 15 | "react-error-boundary": "^4.0.13" 16 | }, 17 | "devDependencies": { 18 | "@tailwindcss/postcss": "^4.0.0", 19 | "@types/react": "npm:types-react@rc", 20 | "@types/react-dom": "npm:types-react-dom@rc", 21 | "@vitejs/plugin-react": "^4.2.1", 22 | "eslint": "^8.57.0", 23 | "eslint-plugin-react": "^7.34.1", 24 | "eslint-plugin-react-hooks": "^4.6.0", 25 | "eslint-plugin-react-refresh": "^0.4.6", 26 | "postcss": "^8.4.38", 27 | "tailwindcss": "^4.0.0", 28 | "vite": "^5.2.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Button from "./Button"; 2 | import TextBox from "./TextBox"; 3 | import CrazyButton from "./CrazyButton"; 4 | import ToolBar from "./ToolBar"; 5 | import Register from "./Register"; 6 | import Navbar from "./Navbar"; 7 | 8 | function App() { 9 | return ( 10 |
    11 | 12 |
    18 | ); 19 | } 20 | 21 | export default App; 22 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/Button.jsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | const Button = () => { 4 | function handleClick() { 5 | console.log("You Clicked Me"); 6 | } 7 | return ( 8 | 9 | ) 10 | } 11 | 12 | export default Button -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/CrazyButton.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from 'prop-types'; 2 | 3 | function Button({message, children}) { 4 | function handleClick(event, message) { 5 | console.log(event.target); 6 | console.log(message); 7 | } 8 | 9 | return ( 10 | 13 | ); 14 | } 15 | 16 | 17 | export default function CrazyButton() { 18 | 19 | return ( 20 |
    21 | 24 | 27 |
    28 | ); 29 | } 30 | 31 | Button.propTypes = { 32 | message: PropTypes.string.isRequired, 33 | children: PropTypes.node.isRequired, 34 | }; -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/Navbar.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | function Button({onClick, children}) { 4 | function handleClick(event) { 5 | event.stopPropagation(); 6 | onClick() 7 | } 8 | return( 9 | 14 | ) 15 | } 16 | 17 | Button.propTypes = { 18 | onClick: PropTypes.func.isRequired, 19 | children: PropTypes.node.isRequired, 20 | }; 21 | 22 | export default function Navbar() { 23 | return ( 24 |
    { 25 | console.log('You clicked on the toolbar!'); 26 | }}> 27 | 30 | 33 |
    34 | ); 35 | } -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/Register.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | 3 | const Register = () => { 4 | const [query, setQuery] = useState(""); 5 | 6 | const handleSubmit = (event) => { 7 | 8 | event.preventDefault(); 9 | console.log(query) 10 | setQuery("") 11 | }; 12 | return ( 13 |
    14 | setQuery(e.target.value)} 18 | placeholder="Enter something..." 19 | /> 20 | 21 |
    22 | ); 23 | }; 24 | 25 | export default Register; 26 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/TextBox.jsx: -------------------------------------------------------------------------------- 1 | 2 | 3 | const TextBox = () => { 4 | function handleChange(event) { 5 | console.log(event.target.valueAsNumber) 6 | } 7 | return ( 8 | 9 | ) 10 | } 11 | 12 | export default TextBox -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/ToolBar.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | function Button({onClick, children}) { 4 | return( 5 | 10 | ) 11 | } 12 | 13 | Button.propTypes = { 14 | onClick: PropTypes.func.isRequired, 15 | children: PropTypes.node.isRequired, 16 | }; 17 | 18 | function PlayButton({movieName}) { 19 | 20 | function handlePlayClick() { 21 | console.log(`Playing ${movieName}!`); 22 | } 23 | 24 | return ( 25 | 26 | ) 27 | } 28 | 29 | PlayButton.propTypes = { 30 | movieName: PropTypes.string.isRequired, 31 | }; 32 | 33 | function UploadButton() { 34 | return( 35 | 36 | ) 37 | } 38 | 39 | const ToolBar = () => { 40 | return ( 41 |
    42 | 43 | 44 |
    45 | ) 46 | } 47 | 48 | export default ToolBar -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/index.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss'; 2 | 3 | /* 4 | The default border color has changed to `currentColor` in Tailwind CSS v4, 5 | so we've added these compatibility styles to make sure everything still 6 | looks the same as it did with Tailwind CSS v3. 7 | 8 | If we ever want to remove these styles, we need to add an explicit border 9 | color utility to any element that depends on these defaults. 10 | */ 11 | @layer base { 12 | *, 13 | ::after, 14 | ::before, 15 | ::backdrop, 16 | ::file-selector-button { 17 | border-color: var(--color-gray-200, currentColor); 18 | } 19 | } -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /08-event-handling/learn-event-handling/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /09-array-object-immutability/README.md: -------------------------------------------------------------------------------- 1 | # 09 - Array and Object Immutability with Movie Watch Project 2 | 3 | Master Array and Object Immutability with Movie Watch Project. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | ## The Video Tutorial 14 | In this video tutorial, we have developed an app considering immutability in mind. 15 | 16 | Here is the video for you to go through and learn: 17 | 18 | [![09-array-object-immutability](./banner.png)](https://youtu.be/BOk1NqAOEJ4 "Video") 19 | 20 | ## Task 21 | Please complete the task assignment from here: [Task](./task.md) 22 | 23 | 24 | -------------------------------------------------------------------------------- /09-array-object-immutability/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/09-array-object-immutability/banner.png -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 4.x 10 | 11 | ## Create Your Own React 19 Project with Vite and TailwindCSS 12 | There are multiple ways you can utilize this repository to create your own project. The most straightforward way is by using the follwoing command from the command prompt/terminal: 13 | 14 | ```bash 15 | npx degit atapas/code-in-react-19#main 16 | ``` 17 | 18 | This will clone the repository to your project. Alternatively, you can fork this repo or create a new repo from the template by clicking on the button at the top-right corner. 19 | 20 | ## 🫶 Support 21 | Liked it? You can show your support with a STAR(⭐). 22 | 23 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 24 | 25 | ### Sponsor My Work 26 | 27 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 28 | 29 | ## Run it Locally 30 | 31 | - Clone or fork the repo 32 | - Install dependencies using `npm install` or `yarn install` 33 | - Run it using `npm run dev` or `yarn dev` 34 | 35 | The app will be available on `http://localhost:5173` by default. 36 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
    11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0", 15 | "react-error-boundary": "^4.0.13", 16 | "react-stars": "^2.2.5" 17 | }, 18 | "devDependencies": { 19 | "@tailwindcss/postcss": "^4.0.0", 20 | "@types/react": "npm:types-react@rc", 21 | "@types/react-dom": "npm:types-react-dom@rc", 22 | "@vitejs/plugin-react": "^4.2.1", 23 | "eslint": "^8.57.0", 24 | "eslint-plugin-react": "^7.34.1", 25 | "eslint-plugin-react-hooks": "^4.6.0", 26 | "eslint-plugin-react-refresh": "^0.4.6", 27 | "postcss": "^8.4.38", 28 | "tailwindcss": "^4.0.0", 29 | "vite": "^5.2.0" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/09-array-object-immutability/movie-watch/src/App.css -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/App.jsx: -------------------------------------------------------------------------------- 1 | import MovieWatchlist from "./MovieWatch"; 2 | //import UserList from "./immutability/UserList"; 3 | function App() { 4 | return ( 5 | <> 6 | 7 | 8 | 9 | 10 | ); 11 | } 12 | 13 | export default App; 14 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/Filter.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | 3 | export default function Filter({ setFilter }) { 4 | return ( 5 |
    6 | 12 | 18 | 24 |
    25 | ); 26 | } 27 | 28 | Filter.propTypes = { 29 | setFilter: PropTypes.func.isRequired, 30 | }; 31 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/Heading.jsx: -------------------------------------------------------------------------------- 1 | const Heading = () => { 2 | return ( 3 |

    4 | 🎬 Movie Watchlist 5 |

    6 | ); 7 | }; 8 | 9 | export default Heading; 10 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/MovieForm.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import PropTypes from "prop-types"; 3 | 4 | export default function MovieForm({ addMovie }) { 5 | const [movieData, setMovieData] = useState({ 6 | title: "", 7 | ott: "" 8 | }); 9 | 10 | const handleChange = (e) => { 11 | const key = e.target.name; 12 | const value = e.target.value; 13 | console.log(key, value) 14 | setMovieData({...movieData, [key]: value}) 15 | } 16 | 17 | const handleSubmit = (e) => { 18 | e.preventDefault(); 19 | console.log(movieData) 20 | if (!movieData?.title.trim() || !movieData?.ott.trim()) return; 21 | addMovie(movieData); 22 | setMovieData({...movieData, title: "", ott: ""}) 23 | }; 24 | 25 | return ( 26 |
    27 | 35 | 49 | 55 |
    56 | ); 57 | } 58 | 59 | MovieForm.propTypes = { 60 | addMovie: PropTypes.func.isRequired, 61 | }; 62 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/MovieItem.jsx: -------------------------------------------------------------------------------- 1 | import PropTypes from "prop-types"; 2 | import ReactStars from "react-stars"; 3 | 4 | export default function MovieItem({ 5 | movie, 6 | rateMovie, 7 | toggleWatched, 8 | deleteMovie, 9 | }) { 10 | const ratingChanged = (newRating) => { 11 | rateMovie(movie.id, newRating); 12 | }; 13 | return ( 14 |
  • 15 | 20 | {movie.title} on {movie.ott} {movie.rating && `⭐ ${movie.rating}/5`} 21 | 22 |
    23 | 30 | 31 | 37 | 43 |
    44 |
  • 45 | ); 46 | } 47 | 48 | MovieItem.propTypes = { 49 | movie: PropTypes.shape({ 50 | id: PropTypes.number.isRequired, 51 | title: PropTypes.string.isRequired, 52 | ott: PropTypes.string.isRequired, 53 | rating: PropTypes.number, 54 | watched: PropTypes.bool.isRequired, 55 | }).isRequired, 56 | rateMovie: PropTypes.func.isRequired, 57 | toggleWatched: PropTypes.func.isRequired, 58 | deleteMovie: PropTypes.func.isRequired, 59 | }; 60 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/MovieList.jsx: -------------------------------------------------------------------------------- 1 | import MovieItem from "./MovieItem"; 2 | import PropTypes from "prop-types"; 3 | 4 | export default function MovieList({ 5 | movies, 6 | rateMovie, 7 | toggleWatched, 8 | deleteMovie, 9 | }) { 10 | return ( 11 |
    12 | {movies.length === 0 ? ( 13 |

    14 | No movies in your watchlist. Add some! 15 |

    16 | ) : ( 17 |
      18 | {movies.map((movie) => ( 19 | 26 | ))} 27 |
    28 | )} 29 |
    30 | ); 31 | } 32 | 33 | MovieList.propTypes = { 34 | movies: PropTypes.arrayOf( 35 | PropTypes.shape({ 36 | id: PropTypes.number.isRequired, 37 | title: PropTypes.string.isRequired, 38 | ott: PropTypes.string.isRequired, 39 | watched: PropTypes.bool.isRequired, 40 | rating: PropTypes.number, 41 | }) 42 | ).isRequired, 43 | rateMovie: PropTypes.func.isRequired, 44 | toggleWatched: PropTypes.func.isRequired, 45 | deleteMovie: PropTypes.func.isRequired, 46 | }; 47 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/MovieWatch.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import Heading from "./Heading"; 3 | import MovieForm from "./MovieForm"; 4 | import MovieList from "./MovieList"; 5 | import Filter from "./Filter"; 6 | 7 | export default function MovieWatchlist() { 8 | const [movies, setMovies] = useState([]); 9 | const [filter, setFilter] = useState("all"); 10 | 11 | // Add new movie (Immutable update) 12 | const addMovie = ({title, ott}) => { 13 | const newMovie = { 14 | id: crypto.randomUUID(), 15 | title, 16 | ott, 17 | rating: null, 18 | watched: false, 19 | }; 20 | setMovies([...movies, newMovie]); // Spread operator to maintain immutability 21 | }; 22 | 23 | // Update rating (Immutable update) 24 | const rateMovie = (id, rating) => { 25 | setMovies(movies.map(movie => 26 | movie.id === id ? { ...movie, rating } : movie 27 | )); 28 | }; 29 | 30 | // Toggle watched status (Immutable update) 31 | const toggleWatched = (id) => { 32 | setMovies(movies.map(movie => 33 | movie.id === id ? { ...movie, watched: !movie.watched } : movie 34 | )); 35 | }; 36 | 37 | // Delete movie (Immutable update) 38 | const deleteMovie = (id) => { 39 | setMovies(movies.filter(movie => movie.id !== id)); 40 | }; 41 | 42 | // Filter movies 43 | const filteredMovies = movies.filter(movie => { 44 | if (filter === "watched") return movie.watched; 45 | if (filter === "unwatched") return !movie.watched; 46 | return true; 47 | }); 48 | 49 | return ( 50 |
    51 | 52 | 53 | 54 | 60 |
    61 | ); 62 | } -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/immutability/UserList.jsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | 3 | const UserList = () => { 4 | const [users, setUsers] = useState([ 5 | { 6 | id: crypto.randomUUID(), 7 | name: "tapas", 8 | address: "bangalore", 9 | }, 10 | ]); 11 | 12 | function changeUser(id, name) { 13 | /*const found = users.find((user) => user.id === id); 14 | found.name = name 15 | console.log(users) 16 | setUsers([...users]);*/ 17 | 18 | const usersCopy = [...users]; 19 | const found = usersCopy.find((user) => user.id === id); 20 | found.name = name; 21 | setUsers(usersCopy); 22 | } 23 | 24 | function addUser() { 25 | /*users[1] = { 26 | id: crypto.randomUUID(), 27 | name: "Jack", 28 | address: "Titanic", 29 | }; 30 | setUsers([...users]); 31 | console.log(users);*/ 32 | 33 | const newUser = { 34 | id: crypto.randomUUID(), 35 | name: "Jack", 36 | address: "Titanic", 37 | }; 38 | 39 | setUsers([...users, newUser]); 40 | } 41 | 42 | return ( 43 |
    44 |
      45 | {users.map((user) => ( 46 |
    • 47 |

      48 | {user.name} lives in {user.address} 49 |

      50 | 56 |
    • 57 | ))} 58 |
    59 | 65 |
    66 | ); 67 | }; 68 | 69 | export default UserList; 70 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/index.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss'; 2 | 3 | /* 4 | The default border color has changed to `currentColor` in Tailwind CSS v4, 5 | so we've added these compatibility styles to make sure everything still 6 | looks the same as it did with Tailwind CSS v3. 7 | 8 | If we ever want to remove these styles, we need to add an explicit border 9 | color utility to any element that depends on these defaults. 10 | */ 11 | @layer base { 12 | *, 13 | ::after, 14 | ::before, 15 | ::backdrop, 16 | ::file-selector-button { 17 | border-color: var(--color-gray-200, currentColor); 18 | } 19 | } 20 | 21 | body{ 22 | background-color: rgba(18, 18, 18, 0.845); 23 | color: #fff; 24 | } -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /09-array-object-immutability/movie-watch/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /09-array-object-immutability/task.md: -------------------------------------------------------------------------------- 1 | ## Tasks 2 | 3 | Thank you for watching and learning. Here are the tasks for you: 4 | 5 | - In the movie watcher app, we haven't implemented the filtering capability. Please build it. I have pushed the code for it so that you can refer to it only when you are stuck. Please try implementing it without seeing first. 6 | - Make sure all the selection and updates to the state is stored in browser's localstorage. If user refreshed the page or come back later, the selection should be persisted. 7 | - Once done, write a good readme of your project, deploy it, and share the project reposrioty link, and deployed URL link on Discord(React e Hatekhori's task channel.) -------------------------------------------------------------------------------- /10-useEffect/README.md: -------------------------------------------------------------------------------- 1 | # 10 - Basics of useEffect 2 | 3 | Master How To Handle Effects(Side Effects) in React. 4 | ## 🫶 Support 5 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 6 | 7 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 8 | 9 | ### 🤝 Sponsor My Work 10 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 11 | 12 | ## The Video Tutorial 13 | In this video tutorial, we have developed an app considering immutability in mind. 14 | 15 | Here is the video for you to go through and learn: 16 | 17 | [![10-useEffect](./banner.png)](https://youtu.be/WgwL4NLAxEg "Video") 18 | 19 | ## Task 20 | Please complete the task assignment from here: [Task](./task.md) 21 | 22 | 23 | -------------------------------------------------------------------------------- /10-useEffect/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tapascript/react-playlist/ed0a3b974c7ac4e331222e210de3cb30b1651db4/10-useEffect/banner.png -------------------------------------------------------------------------------- /10-useEffect/task.md: -------------------------------------------------------------------------------- 1 | # Tasks 2 | 3 | Thank you for watching and learning. Here are the tasks for you: 4 | 5 | ## Random Joke Generator with Categories & Loading State 6 | create a React component that: 7 | - Fetches a random joke based on a selected category. 8 | - Displays a loading indicator while fetching. 9 | - Handles API errors gracefully. 10 | 11 | Fetch Jokes Based on Category: 12 | - Use this API: https://official-joke-api.appspot.com/jokes/{category}/random 13 | - Available categories: "general", "programming", "knock-knock". 14 | - You should have a select box to select a category. 15 | - On selcting a category, the joke for that category will be rendered. 16 | - You should have a loading indicator to show loading when data is being fetched. 17 | 18 | ## Expected Output 19 | 20 | - ✅ On load → Fetches and displays a joke from the general category. 21 | - ✅ Selecting “Programming” → Fetches a programming joke. 22 | - ✅ Selecting “Knock-Knock” → Fetches a knock-knock joke. 23 | - ✅ Clicking “Get New Joke” → Fetches a new joke from the selected category. 24 | - ✅ If the API fails → Shows "Failed to fetch joke" in red. 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { browser: true, es2020: true }, 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:react/recommended', 7 | 'plugin:react/jsx-runtime', 8 | 'plugin:react-hooks/recommended', 9 | ], 10 | ignorePatterns: ['dist', '.eslintrc.cjs'], 11 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 12 | settings: { react: { version: '18.2' } }, 13 | plugins: ['react-refresh'], 14 | rules: { 15 | 'react/jsx-no-target-blank': 'off', 16 | 'react-refresh/only-export-components': [ 17 | 'warn', 18 | { allowConstantExport: true }, 19 | ], 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/README.md: -------------------------------------------------------------------------------- 1 | # Code in React 19 2 | 3 | As React 19 is new, this scaffolding project is for everyone who wants to start coding in React 19. 4 | 5 | It has: 6 | 7 | - Vite 8 | - React 19.0(Stable Version) 9 | - TailwindCSS 4.x 10 | 11 | ## Create Your Own React 19 Project with Vite and TailwindCSS 12 | There are multiple ways you can utilize this repository to create your own project. The most straightforward way is by using the follwoing command from the command prompt/terminal: 13 | 14 | ```bash 15 | npx degit atapas/code-in-react-19#main 16 | ``` 17 | 18 | This will clone the repository to your project. Alternatively, you can fork this repo or create a new repo from the template by clicking on the button at the top-right corner. 19 | 20 | ## 🫶 Support 21 | Liked it? You can show your support with a STAR(⭐). 22 | 23 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 24 | 25 | ### Sponsor My Work 26 | 27 | > I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. You can support my work by [sponsoring me on GitHub](https://github.com/sponsors/atapas). 28 | 29 | ## Run it Locally 30 | 31 | - Clone or fork the repo 32 | - Install dependencies using `npm install` or `yarn install` 33 | - Run it using `npm run dev` or `yarn dev` 34 | 35 | The app will be available on `http://localhost:5173` by default. 36 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
    11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "code-in-react-19", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "react": "^19.0.0", 14 | "react-dom": "^19.0.0", 15 | "react-error-boundary": "^4.0.13" 16 | }, 17 | "devDependencies": { 18 | "@tailwindcss/postcss": "^4.0.0", 19 | "@types/react": "npm:types-react@rc", 20 | "@types/react-dom": "npm:types-react-dom@rc", 21 | "@vitejs/plugin-react": "^4.2.1", 22 | "eslint": "^8.57.0", 23 | "eslint-plugin-react": "^7.34.1", 24 | "eslint-plugin-react-hooks": "^4.6.0", 25 | "eslint-plugin-react-refresh": "^0.4.6", 26 | "postcss": "^8.4.38", 27 | "tailwindcss": "^4.0.0", 28 | "vite": "^5.2.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | '@tailwindcss/postcss': {}, 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/App.css: -------------------------------------------------------------------------------- 1 | #root { 2 | max-width: 1280px; 3 | margin: 0 auto; 4 | padding: 2rem; 5 | text-align: center; 6 | } 7 | 8 | .logo { 9 | height: 6em; 10 | padding: 1.5em; 11 | will-change: filter; 12 | transition: filter 300ms; 13 | } 14 | .logo:hover { 15 | filter: drop-shadow(0 0 2em #646cffaa); 16 | } 17 | .logo.react:hover { 18 | filter: drop-shadow(0 0 2em #61dafbaa); 19 | } 20 | 21 | @keyframes logo-spin { 22 | from { 23 | transform: rotate(0deg); 24 | } 25 | to { 26 | transform: rotate(360deg); 27 | } 28 | } 29 | 30 | @media (prefers-reduced-motion: no-preference) { 31 | a:nth-of-type(2) .logo { 32 | animation: logo-spin infinite 20s linear; 33 | } 34 | } 35 | 36 | .card { 37 | padding: 2em; 38 | } 39 | 40 | .read-the-docs { 41 | color: #888; 42 | } 43 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/App.jsx: -------------------------------------------------------------------------------- 1 | import Basics from "./Basics"; 2 | import StateChangeEffect from "./StateChangeEffect"; 3 | import PropsChangeEffect from "./PropsChangeEffect"; 4 | function App() { 5 | return ( 6 |
    7 |

    UseEffect

    8 | 9 | 10 | 11 |
    12 | ); 13 | } 14 | 15 | export default App; 16 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/Basics.jsx: -------------------------------------------------------------------------------- 1 | import {useState, useEffect} from "react"; 2 | 3 | const Basics = () => { 4 | const [data, setData] = useState(null); 5 | 6 | useEffect(() => { 7 | // Side Effect Logic 8 | fetch("https://jsonplaceholder.typicode.com/posts/1") 9 | .then((response) => response.json()) 10 | .then((json) => setData(json)); 11 | }, []); 12 | 13 | return ( 14 |
    15 |

    Fetched Data

    16 | {data ?

    {data?.title}

    :

    Loading...

    } 17 |
    18 | ) 19 | } 20 | 21 | export default Basics -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/CleanupEffect.jsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | 3 | const CleanupEffect = () => { 4 | const [width, setWidth] = useState(window.innerWidth); 5 | 6 | useEffect(() => { 7 | const handleResize = () => setWidth(window.innerWidth); 8 | window.addEventListener("resize", handleResize); 9 | 10 | return () => { 11 | window.removeEventListener("resize", handleResize); 12 | }; 13 | }, []); 14 | 15 | return

    Window width: {width}px

    ; 16 | }; 17 | 18 | export default CleanupEffect; 19 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/PropsChangeEffect.jsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import PropTypes from 'prop-types'; 3 | 4 | const PropsChangeEffect = ({userId}) => { 5 | const [user, setUser] = useState(null); 6 | 7 | useEffect(()=> { 8 | fetch(`https://jsonplaceholder.typicode.com/users/${userId}`) 9 | .then((res) => res.json()) 10 | .then((data) => setUser(data)); 11 | }, [userId]) 12 | return ( 13 |
    14 |

    User Details

    15 | {user ?

    {user?.name}

    :

    Loading...

    } 16 |
    17 | ) 18 | } 19 | PropsChangeEffect.propTypes = { 20 | userId: PropTypes.number.isRequired, 21 | }; 22 | 23 | export default PropsChangeEffect; 24 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/StateChangeEffect.jsx: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from "react"; 2 | 3 | const StateChangeEffect = () => { 4 | const [count, setCount] = useState(0); 5 | useEffect(() => { 6 | document.title = `Count: ${count}`; 7 | }, [count]); 8 | return ( 9 |
    10 |

    {count}

    11 | 12 |
    13 | ) 14 | } 15 | 16 | export default StateChangeEffect -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/assets/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/index.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss'; 2 | 3 | /* 4 | The default border color has changed to `currentColor` in Tailwind CSS v4, 5 | so we've added these compatibility styles to make sure everything still 6 | looks the same as it did with Tailwind CSS v3. 7 | 8 | If we ever want to remove these styles, we need to add an explicit border 9 | color utility to any element that depends on these defaults. 10 | */ 11 | @layer base { 12 | *, 13 | ::after, 14 | ::before, 15 | ::backdrop, 16 | ::file-selector-button { 17 | border-color: var(--color-gray-200, currentColor); 18 | } 19 | } -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/src/main.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import ReactDOM from 'react-dom/client' 3 | import App from './App.jsx' 4 | import './index.css' 5 | 6 | ReactDOM.createRoot(document.getElementById('root')).render( 7 | 8 | 9 | , 10 | ) 11 | -------------------------------------------------------------------------------- /10-useEffect/useeffect-lesson/vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | }) 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React-এ হাতেখড়ি ✍️ 2 | 3 | Source code and projects for a complete React Playlist in Bangla will make you a React Developer who can build production-ready applications. 4 | 5 | ## 🫶 Support 6 | Liked it? It takes months of hard work to create quality content and present to you. You can show your support to me with a STAR(⭐) to this repository. 7 | 8 | > Many Thanks to all the `Stargazers` who have supported this project with stars(⭐) 9 | 10 | ### 🤝 Sponsor My Work 11 | I am an independent educator and open-source enthusiast who creates meaningful projects to teach programming on my YouTube Channel. **You can support my work by [Sponsoring me on GitHub](https://github.com/sponsors/atapas) or [Buy Me a Cofee](https://buymeacoffee.com/tapasadhikary)**. 12 | 13 | ## Table of Content 14 | 15 | - **`01-Why React?`** - [Watch Video](https://youtu.be/JSLTS3dfHKU) || [Source Code](./01-why-react/README.md) 16 | - **`02-Code Environment`** - [Watch Video](https://youtu.be/9PZ4uymTAz0) || [Source Code](./02-code-environment/README.md) 17 | - **`03-Thinking in React: Components`** - [Watch Video](https://youtu.be/Byy41AxCK88) || [Source Code](./03-thinking-in-react/README.md) 18 | - **`04-Identify State and Props`** - [Watch Video](https://youtu.be/oB2qBjMiDpE) || [Source Code](./04-identify-state-props/README.md) 19 | - **`05-Master JSX`** - [Watch Video](https://www.youtube.com/watch?v=fPBW7Pn6O38&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=5) || [Source Code](./05-mastering-jsx/README.md) 20 | - **`06-Props Readonly`** - [Watch Video](https://www.youtube.com/watch?v=hMeay764V-Q&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=6) || [Source Code](https://github.com/tapascript/props-readonly) 21 | - **`07-Tailwind CSS 4.x and React`** - [Watch Video](https://www.youtube.com/watch?v=X07QLNsm1kE&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=7) 22 | - **`08-React Events`** - [Watch Video](https://www.youtube.com/watch?v=MHxltS0XXlU&list=PLRFcjW6Dq28m95keSmOdGxvQqFvKsNwri&index=9) || [Source Code](./08-event-handling/README.md) 23 | - **`09-React and Immutability With Project`** - [Watch Video](https://youtu.be/BOk1NqAOEJ4) || [Source Code](./09-array-object-immutability/README.md) 24 | - **`10-useEffect Basics With Examples`** - [Watch Video](https://youtu.be/WgwL4NLAxEg) || [Source Code](./10-useEffect/README.md) 25 | 26 | 27 | --------------------------------------------------------------------------------