βοΈ React Basics (Components, Props, State)
Now you move from simple websites β modern frontend apps.
React is used in real companies like Netflix, Facebook, Airbnb.
βοΈ What is React
React is a JavaScript library for building UI.
π Developed by Facebook
π Used to build fast interactive apps
π Component-based architecture
Simple meaning
β’ Break UI into small reusable pieces
Example
β’ Navbar β component
β’ Card β component
β’ Button β component
π§± Why React is Used
Without React
β’ DOM updates become complex
β’ Code becomes messy
React solves:
β Faster UI updates (Virtual DOM)
β Reusable components
β Clean structure
β Easy state management
π§© Core Concept 1: Components
β What is a component
A component is a reusable UI block.
Think like LEGO blocks.
βοΈ Simple React Component
Use component
π¦ Types of Components
πΉ Functional Components (Most Used)
πΉ Class Components (Old)
Less used today.
β Why components matter
β’ Reusable code
β’ Easy maintenance
β’ Clean structure
π€ Core Concept 2: Props (Passing Data)
β What are props
Props = data passed to components.
Parent β Child communication.
Example
Use
Output π Hello Deepak
π§ Props Rules
β’ Read-only
β’ Cannot modify inside component
β’ Used for customization
π Core Concept 3: State (Dynamic Data)
β What is state
State stores changing data inside component.
If state changes β UI updates automatically.
Example using useState
π§ How state works
β’ count β current value
β’ setCount() β update value
β’ UI re-renders automatically
This is Reactβs biggest power.
βοΈ Props vs State (Important Interview Question)
| Props | State |
|-------|-------|
| Passed from parent | Managed inside component |
| Read-only | Can change |
| External data | Internal data |
β οΈ Common Beginner Mistakes
β’ Modifying props
β’ Forgetting import of useState
β’ Confusing props and state
β’ Not using components properly
π§ͺ Mini Practice Task
β’ Create a component that shows your name
β’ Pass name using props
β’ Create counter using state
β’ Add button to increase count
β Mini Practice Task β Solution
π¦ 1οΈβ£ Create a component that shows your name
β Simple reusable component
β Displays static text
π€ 2οΈβ£ Pass name using props
Use inside App.js
β Parent sends data
β Component displays dynamic value
π 3οΈβ£ Create counter using state
β State stores changing value
β UI updates automatically
β 4οΈβ£ Add button to increase count
β Click β state updates β UI re-renders
π§© How to use everything in App.js
β‘οΈ Double Tap β₯οΈ For More
Now you move from simple websites β modern frontend apps.
React is used in real companies like Netflix, Facebook, Airbnb.
βοΈ What is React
React is a JavaScript library for building UI.
π Developed by Facebook
π Used to build fast interactive apps
π Component-based architecture
Simple meaning
β’ Break UI into small reusable pieces
Example
β’ Navbar β component
β’ Card β component
β’ Button β component
π§± Why React is Used
Without React
β’ DOM updates become complex
β’ Code becomes messy
React solves:
β Faster UI updates (Virtual DOM)
β Reusable components
β Clean structure
β Easy state management
π§© Core Concept 1: Components
β What is a component
A component is a reusable UI block.
Think like LEGO blocks.
βοΈ Simple React Component
function Welcome() {
return <h1>Hello User</h1>;
}
Use component
<Welcome />
π¦ Types of Components
πΉ Functional Components (Most Used)
function Header() {
return <h1>My Website</h1>;
}
πΉ Class Components (Old)
Less used today.
β Why components matter
β’ Reusable code
β’ Easy maintenance
β’ Clean structure
π€ Core Concept 2: Props (Passing Data)
β What are props
Props = data passed to components.
Parent β Child communication.
Example
function Welcome(props) {
return <h1>Hello {props.name}</h1>;
}
Use
<Welcome name="Deepak" />
Output π Hello Deepak
π§ Props Rules
β’ Read-only
β’ Cannot modify inside component
β’ Used for customization
π Core Concept 3: State (Dynamic Data)
β What is state
State stores changing data inside component.
If state changes β UI updates automatically.
Example using useState
import { useState } from "react";
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<p>{count}</p>
<button onClick={() => setCount(count + 1)}>
Increase
</button>
</div>
);
}
π§ How state works
β’ count β current value
β’ setCount() β update value
β’ UI re-renders automatically
This is Reactβs biggest power.
βοΈ Props vs State (Important Interview Question)
| Props | State |
|-------|-------|
| Passed from parent | Managed inside component |
| Read-only | Can change |
| External data | Internal data |
β οΈ Common Beginner Mistakes
β’ Modifying props
β’ Forgetting import of useState
β’ Confusing props and state
β’ Not using components properly
π§ͺ Mini Practice Task
β’ Create a component that shows your name
β’ Pass name using props
β’ Create counter using state
β’ Add button to increase count
β Mini Practice Task β Solution
π¦ 1οΈβ£ Create a component that shows your name
function MyName() {
return <h2>My name is Deepak</h2>;
}
export default MyName;
β Simple reusable component
β Displays static text
π€ 2οΈβ£ Pass name using props
function Welcome(props) {
return <h2>Hello {props.name}</h2>;
}
export default Welcome;
Use inside App.js
<Welcome name="Deepak" />
β Parent sends data
β Component displays dynamic value
π 3οΈβ£ Create counter using state
import { useState } from "react";
function Counter() {
const [count, setCount] = useState(0);
return <h2>Count: {count}</h2>;
}
export default Counter;
β State stores changing value
β UI updates automatically
β 4οΈβ£ Add button to increase count
import { useState } from "react";
function Counter() {
const [count, setCount] = useState(0);
return (
<div>
<h2>Count: {count}</h2>
<button onClick={() => setCount(count + 1)}>
Increase
</button>
</div>
);
}
export default Counter;
β Click β state updates β UI re-renders
π§© How to use everything in App.js
import MyName from "./MyName";
import Welcome from "./Welcome";
import Counter from "./Counter";
function App() {
return (
<div>
<MyName />
<Welcome name="Deepak" />
<Counter />
</div>
);
}
export default App;
β‘οΈ Double Tap β₯οΈ For More
β€3
Let me explain all the major programming languages in detail so you can better understand which one would be the best fit for you starting with Python
Python Programming Roadmap
Python is beginner-friendly, used in web dev, data science, AI, automation, and is often the first choice for programming newbies.
Step 1: Learn the Basics
Time: 1β2 weeks
Variables (name = "John")
Data Types (int, float, string, list, etc.)
Input and Output (input(), print())
Operators (+, -, *, /, %, //)
Indentation and Syntax rules
*Practice Ideas:*
Build a simple calculator
Create a name greeter
Make a temperature converter
Resources :
- w3schools
- freeCodeCamp
Step 2: Control Flow and Loops
Time: 1 week
- If-else conditions
- For loops and while loops
- Loop control: break, continue, pass
Practice Ideas:
- FizzBuzz
- Number guessing game
- Print star patterns
Step 3: Data Structures in Python
Time: 1β2 weeks
- Lists, Tuples, Sets, Dictionaries
- List Methods: append(), remove(), sort()
- Dictionary Methods: get(), keys(), values()
Practice Ideas:
- Create a contact book
- Word frequency counter
- Store student scores in a dictionary
Step 4: Functions
Time: 1 week
- Define functions using def
- Return statements
- Arguments and Parameters (*args, **kwargs)
- Variable Scope
*Practice Ideas:*
- ATM simulator
- Password generator
- Function-based calculator
Step 5: File Handling and Exceptions
Time: 1 week
- Open, read, write files
- Use of with open(...) as f:
- Try-Except blocks
Practice Ideas:
- Log user data to a file
- Read and analyze text files
- Save login data
Step 6: Object-Oriented Programming (OOP)
Time: 1β2 weeks
- Classes and Objects
- The init() constructor
- Inheritance
- Encapsulation
*Practice Ideas* :
- Build a class for a Bank Account
- Design a Library Management System
- Build a Rental System
Step 7: Choose any Specialization Track
a. Data Science & ML
Learn: NumPy, Pandas, Matplotlib, Seaborn, Scikit-learn
Projects: Analyze sales data, build prediction models
b. Web Development
Learn: Flask or Django, HTML, CSS, SQLite/PostgreSQL
Projects: Portfolio site, blog app, task manager
c. Automation/Scripting
Learn: Selenium, PyAutoGUI, os module, shutil
Projects: Auto-login bot, bulk file renamer, web scraper
d. AI & Deep Learning
Learn: TensorFlow, PyTorch, OpenCV
Projects: Image classification, face detection, chatbots
Final Step: Build Projects & Share on GitHub
- Upload code to GitHub
- Start with 2β3 real-world projects
- Create a personal portfolio site
*Use Replit or Jupyter Notebooks for practice*
*Practice daily β consistency matters more than speed*
@CodingCoursePro
Shared with Loveβ
Python Programming Roadmap
Python is beginner-friendly, used in web dev, data science, AI, automation, and is often the first choice for programming newbies.
Step 1: Learn the Basics
Time: 1β2 weeks
Variables (name = "John")
Data Types (int, float, string, list, etc.)
Input and Output (input(), print())
Operators (+, -, *, /, %, //)
Indentation and Syntax rules
*Practice Ideas:*
Build a simple calculator
Create a name greeter
Make a temperature converter
Resources :
- w3schools
- freeCodeCamp
Step 2: Control Flow and Loops
Time: 1 week
- If-else conditions
- For loops and while loops
- Loop control: break, continue, pass
Practice Ideas:
- FizzBuzz
- Number guessing game
- Print star patterns
Step 3: Data Structures in Python
Time: 1β2 weeks
- Lists, Tuples, Sets, Dictionaries
- List Methods: append(), remove(), sort()
- Dictionary Methods: get(), keys(), values()
Practice Ideas:
- Create a contact book
- Word frequency counter
- Store student scores in a dictionary
Step 4: Functions
Time: 1 week
- Define functions using def
- Return statements
- Arguments and Parameters (*args, **kwargs)
- Variable Scope
*Practice Ideas:*
- ATM simulator
- Password generator
- Function-based calculator
Step 5: File Handling and Exceptions
Time: 1 week
- Open, read, write files
- Use of with open(...) as f:
- Try-Except blocks
Practice Ideas:
- Log user data to a file
- Read and analyze text files
- Save login data
Step 6: Object-Oriented Programming (OOP)
Time: 1β2 weeks
- Classes and Objects
- The init() constructor
- Inheritance
- Encapsulation
*Practice Ideas* :
- Build a class for a Bank Account
- Design a Library Management System
- Build a Rental System
Step 7: Choose any Specialization Track
a. Data Science & ML
Learn: NumPy, Pandas, Matplotlib, Seaborn, Scikit-learn
Projects: Analyze sales data, build prediction models
b. Web Development
Learn: Flask or Django, HTML, CSS, SQLite/PostgreSQL
Projects: Portfolio site, blog app, task manager
c. Automation/Scripting
Learn: Selenium, PyAutoGUI, os module, shutil
Projects: Auto-login bot, bulk file renamer, web scraper
d. AI & Deep Learning
Learn: TensorFlow, PyTorch, OpenCV
Projects: Image classification, face detection, chatbots
Final Step: Build Projects & Share on GitHub
- Upload code to GitHub
- Start with 2β3 real-world projects
- Create a personal portfolio site
*Use Replit or Jupyter Notebooks for practice*
*Practice daily β consistency matters more than speed*
@CodingCoursePro
Shared with Love
Please open Telegram to view this post
VIEW IN TELEGRAM
β€1
Check out the list of top 10 Python projects on GitHub given below.
1. Magenta: Explore the artist inside you with this python project. A Google Brainβs brainchild, it leverages deep learning and reinforcement learning algorithms to create drawings, music, and other similar artistic products.
2. Photon: Designing web crawlers can be fun with the Photon project. It is a fast crawler designed for open-source intelligence tools. Photon project helps you perform data crawling functions, which include extracting data from URLs, e-mails, social media accounts, XML and pdf files, and Amazon buckets.
3. Mail Pile: Want to learn some encrypting tricks? This project on GitHub can help you learn to send and receive PGP encrypted electronic mails. Powered by Bayesian classifiers, it is capable of automatic tagging and handling huge volumes of email data, all organized in a clean web interface.
4. XS Strike: XS Strike helps you design a vulnerability to check your networkβs security. It is a security suite developed to detect vulnerability attacks. XSS attacks inject malicious scripts into web pages. XSSβs features include four handwritten parsers, a payload generator, a fuzzing engine, and a fast crawler.
5. Google Images Download: It is a script that looks for keywords and phrases to optionally download the image files. All you need to do is, replicate the source code of this project to get a sense of how it works in practice.
6. Pandas Project: Pandas library is a collection of data structures that can be used for flexible data analysis and data manipulation. Compared to other libraries, its flexibility, intuitiveness, and automated data manipulation processes make it a better choice for data manipulation.
7. Xonsh: Used for designing interactive applications without the need for command-line interpreters like Unix. It is a Python-powered Shell language that commands promptly. An easily scriptable application that comes with a standard library, and various types of variables and has its own virtual environment management system.
8. Manim: The Mathematical Animation Engine, Manim, can create video explainers. Using Python 3.7, it produces animated videos, with added illustrations and display graphs. Its source code is freely available on GitHub and for tutorials and installation guides, you can refer to their 3Blue1Brown YouTube channel.
9. AI Basketball Analysis: It is an artificial intelligence application that analyses basketball shots using an object detection concept. All you need to do is upload the files or submit them as a post requests to the API. Then the OpenPose library carries out the calculations to generate the results.
10. Rebound: A great project to put Python to use in building Stackoverflow content, this tool is built on the Urwid console user interface, and solves compiler errors. Using this tool, you can learn how the Beautiful Soup package scrapes StackOverflow and how subprocesses work to find compiler errors.
@CodingCoursePro
Shared with Loveβ
1. Magenta: Explore the artist inside you with this python project. A Google Brainβs brainchild, it leverages deep learning and reinforcement learning algorithms to create drawings, music, and other similar artistic products.
2. Photon: Designing web crawlers can be fun with the Photon project. It is a fast crawler designed for open-source intelligence tools. Photon project helps you perform data crawling functions, which include extracting data from URLs, e-mails, social media accounts, XML and pdf files, and Amazon buckets.
3. Mail Pile: Want to learn some encrypting tricks? This project on GitHub can help you learn to send and receive PGP encrypted electronic mails. Powered by Bayesian classifiers, it is capable of automatic tagging and handling huge volumes of email data, all organized in a clean web interface.
4. XS Strike: XS Strike helps you design a vulnerability to check your networkβs security. It is a security suite developed to detect vulnerability attacks. XSS attacks inject malicious scripts into web pages. XSSβs features include four handwritten parsers, a payload generator, a fuzzing engine, and a fast crawler.
5. Google Images Download: It is a script that looks for keywords and phrases to optionally download the image files. All you need to do is, replicate the source code of this project to get a sense of how it works in practice.
6. Pandas Project: Pandas library is a collection of data structures that can be used for flexible data analysis and data manipulation. Compared to other libraries, its flexibility, intuitiveness, and automated data manipulation processes make it a better choice for data manipulation.
7. Xonsh: Used for designing interactive applications without the need for command-line interpreters like Unix. It is a Python-powered Shell language that commands promptly. An easily scriptable application that comes with a standard library, and various types of variables and has its own virtual environment management system.
8. Manim: The Mathematical Animation Engine, Manim, can create video explainers. Using Python 3.7, it produces animated videos, with added illustrations and display graphs. Its source code is freely available on GitHub and for tutorials and installation guides, you can refer to their 3Blue1Brown YouTube channel.
9. AI Basketball Analysis: It is an artificial intelligence application that analyses basketball shots using an object detection concept. All you need to do is upload the files or submit them as a post requests to the API. Then the OpenPose library carries out the calculations to generate the results.
10. Rebound: A great project to put Python to use in building Stackoverflow content, this tool is built on the Urwid console user interface, and solves compiler errors. Using this tool, you can learn how the Beautiful Soup package scrapes StackOverflow and how subprocesses work to find compiler errors.
@CodingCoursePro
Shared with Love
Please open Telegram to view this post
VIEW IN TELEGRAM
@CodingCoursePro
Shared with Love
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
Now, let's move to the next topic in Web Development Roadmap:
βοΈ JSX & React Project Structure
This topic explains how React writes UI code and how React apps are organized.
π§© What is JSX β
JSX Meaning JSX = JavaScript XML
π Allows writing HTML inside JavaScript. Simple meaning
- HTML-like syntax inside JS
- Makes UI code easier to write
π§ Why JSX Exists
Without JSX (pure JS)
With JSX (easy)
β Cleaner β Readable β Faster development
βοΈ Basic JSX Example
βοΈ Looks like HTML βοΈ Actually converted to JavaScript
β οΈ JSX Rules (Very Important)
1. Return only one parent element
β Wrong
β Correct
2. Use className instead of class
Because
3. Close all tags
4. JavaScript inside { }
βοΈ Dynamic content rendering
π JSX Expressions
You can use:
- Variables
- Functions
- Conditions
Example
π React Project Structure
When you create a React app, files follow a structure.
π Typical React Folder Structure
π¦ Important Folders Explained
π public/
- Static files
- index.html
- Images
- Favicon
Browser loads this first.
π src/ (Most Important)
- Main application code
- Components
- Styles
- Logic
You work here daily.
π App.js
- Main component
- Controls UI structure
- Parent of all components
π index.js
- Entry point of app
- Renders App into DOM
Example idea
π package.json
- Project dependencies
- Scripts
- Version info
π§ How React App Runs (Flow)
1οΈβ£ index.html loads
2οΈβ£ index.js runs
3οΈβ£ App component renders
4οΈβ£ UI appears
β οΈ Common Beginner Mistakes
- Multiple parent elements in JSX
- Using
- Forgetting to close tags
- Editing files outside
π§ͺ Mini Practice Task
- Create JSX heading showing your name
- Use variable inside JSX
- Create simple component folder structure
- Create a new component and use inside App
β Mini Practice Task β Solution βοΈ
π¦ 1οΈβ£ Create JSX heading showing your name
π Inside
βοΈ JSX looks like HTML
βοΈ React renders heading on screen
π€ 2οΈβ£ Use variable inside JSX
π JavaScript values go inside
βοΈ Dynamic content rendering
βοΈ React updates if value changes
π 3οΈβ£ Create simple component folder structure
Inside
βοΈ
βοΈ Better project organization
π§© 4οΈβ£ Create new component and use inside App
β Step 1: Create
β Step 2: Use component in
βοΈ Component reused
βοΈ Clean UI structure
π§ What you learned
β Writing JSX
β Using variables inside JSX
β Organizing React project
β Creating reusable components
@CodingCoursePro
Shared with Loveβ
Double Tap β₯οΈ For More
βοΈ JSX & React Project Structure
This topic explains how React writes UI code and how React apps are organized.
π§© What is JSX β
JSX Meaning JSX = JavaScript XML
π Allows writing HTML inside JavaScript. Simple meaning
- HTML-like syntax inside JS
- Makes UI code easier to write
π§ Why JSX Exists
Without JSX (pure JS)
React.createElement("h1", null, "Hello");With JSX (easy)
<h1>Hello</h1>β Cleaner β Readable β Faster development
βοΈ Basic JSX Example
function App() {
return <h1>Hello React</h1>;
}
βοΈ Looks like HTML βοΈ Actually converted to JavaScript
β οΈ JSX Rules (Very Important)
1. Return only one parent element
β Wrong
return ( <h1>Hello</h1> <p>Welcome</p> );β Correct
return ( <div> <h1>Hello</h1> <p>Welcome</p> </div> );2. Use className instead of class
<div className="box"></div>Because
class is reserved in JavaScript.3. Close all tags
<img src="logo.png" /><input />4. JavaScript inside { }
const name = "Deepak";
return <h1>Hello {name}</h1>;
βοΈ Dynamic content rendering
π JSX Expressions
You can use:
- Variables
- Functions
- Conditions
Example
let age = 20;return <p>{age >= 18 ? "Adult" : "Minor"}</p>;π React Project Structure
When you create a React app, files follow a structure.
π Typical React Folder Structure
my-app/
βββ node_modules/
βββ public/
βββ src/
β βββ App.js
β βββ index.js
β βββ components/
β βββ styles/
βββ package.json
π¦ Important Folders Explained
π public/
- Static files
- index.html
- Images
- Favicon
Browser loads this first.
π src/ (Most Important)
- Main application code
- Components
- Styles
- Logic
You work here daily.
π App.js
- Main component
- Controls UI structure
- Parent of all components
π index.js
- Entry point of app
- Renders App into DOM
Example idea
ReactDOM.render(<App />, document.getElementById("root"));π package.json
- Project dependencies
- Scripts
- Version info
π§ How React App Runs (Flow)
1οΈβ£ index.html loads
2οΈβ£ index.js runs
3οΈβ£ App component renders
4οΈβ£ UI appears
β οΈ Common Beginner Mistakes
- Multiple parent elements in JSX
- Using
class instead of className- Forgetting to close tags
- Editing files outside
srcπ§ͺ Mini Practice Task
- Create JSX heading showing your name
- Use variable inside JSX
- Create simple component folder structure
- Create a new component and use inside App
β Mini Practice Task β Solution βοΈ
π¦ 1οΈβ£ Create JSX heading showing your name
π Inside
App.jsfunction App() {
return <h1>My name is Deepak</h1>;
}
export default App;
βοΈ JSX looks like HTML
βοΈ React renders heading on screen
π€ 2οΈβ£ Use variable inside JSX
π JavaScript values go inside
{ }function App() {
const name = "Deepak";
return <h1>Hello {name}</h1>;
}
export default App;
βοΈ Dynamic content rendering
βοΈ React updates if value changes
π 3οΈβ£ Create simple component folder structure
Inside
src/ folder create:src/
βββ App.js
βββ index.js
βββ components/
βββ Header.js
βοΈ
components/ keeps reusable UI codeβοΈ Better project organization
π§© 4οΈβ£ Create new component and use inside App
β Step 1: Create
Header.js inside components/function Header() {
return <h2>Welcome to My Website</h2>;
}
export default Header;
β Step 2: Use component in
App.jsimport Header from "./components/Header";
function App() {
return (
<div>
<Header />
<h1>Hello React</h1>
</div>
);
}
export default App;
βοΈ Component reused
βοΈ Clean UI structure
π§ What you learned
β Writing JSX
β Using variables inside JSX
β Organizing React project
β Creating reusable components
@CodingCoursePro
Shared with Love
Double Tap β₯οΈ For More
Please open Telegram to view this post
VIEW IN TELEGRAM