Mohammed Junaid Profile picture
Sep 9, 2023 12 tweets 3 min read Read on X
Components in React.

Explained: Image
Real-Life Example:

Imagine building a house 🏠.

Each room (kitchen, bedroom, bathroom) represents a component.

React components contain particular UI and behaviour, just as rooms have particular purposes and looks.

Let's explore these "rooms" in the world of React!
🔹 Functional Components:

• Simpler and more concise.
• Stateless (initially).
• Use functions to return JSX.
• With Hooks, they've become even more powerful!

Example: Image
🔹 Class Components:

• "Component" is React's foundational class.
• Components can be defined using JavaScript classes.
• React continues to support these class components.
• Yet, they're not advised for new projects.

Example: Image
🔸 Props:

• Short for "properties".
• A way to pass data from parent to child components.
• Immutable (read-only). Image
🔸 State:

Internal data storage for components.

• this.setState() in class components.
• useState() hook in functional components.
🔸 Lifecycle Methods & Effects:

• Class components have lifecycle methods like componentDidMount(), componentDidUpdate(), etc.

• Functional components use the useEffect() hook for similar purposes.
🔸 Composition vs Inheritance:

React favours composition.

Instead of inheriting from a base component, you "compose" your UI by nesting components.

Example: Image
🔸 Higher-Order Components (HOCs):

A design pattern where a component wraps another, adding additional props or state.

Great for code reuse.

Example: Image
Components are the essence of React.

They make our UI:
• Modular
• Maintainable
• Intuitive.

Whether you opt for class or functional components, mastering their fundamentals is crucial! 🚀
Learn React in 30 Days.

📘 React Rangers: 30-Days of React!

Grab now: reactrangers.xyz
Image
That's a wrap.

Follow @mdjunaidap for more.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Mohammed Junaid

Mohammed Junaid Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mdjunaidap

Jan 6
Don’t manage your AI.

Proactive AI is now live—

paying attention in the background instead.

That’s Looki L1. Image
1/ 📷 Meet Looki L1. The physical body of true Proactive AI.

🤫 AI doesn’t need to be loud to be useful.

That’s what I liked about Looki L1.
- 32 grams on the wrist.
- IP67 for real life.

Nothing flashy. Nothing in the way.

→ 12 hours of intelligence running quietly
→ Context-aware, without pressure
2/ 🆚 Reactive AI vs Proactive AI.

Why most AI still feels heavy

— Pause your day
— Explain what you’re doing
— Re-engage your focus

❗️Looki does less.

It reads the moment quietly and steps in only when it helps.

Your day keeps moving.
Read 8 tweets
Aug 18, 2025
This ChatGPT trick will make you understand ANYTHING in 5 minutes.

and nobody's talking about it:
Just type "ELI5:" before ANY topic and watch magic happen.
ELI5 = "Explain Like I'm 5"

You can ask complex topics like this:

- Quantum physics
- Cryptocurrency
- Stock options
- Machine learning
- Blockchain tech

All in plain English. All in under 5 minutes each.
Read 6 tweets
Apr 18, 2025
If you’re running Meta Ads and not tracking THIS,

you’re not just guessing—you’re wasting money.

A quick thread on the most common $500+ mistake beginners make (and how to fix it):
Meta’s algorithm is smart—but only if you feed it the right data.
The #1 way beginners waste their budget?

Broken or missing pixel setups.

No pixel = no learning
No learning = wasted ad spend
The Meta Pixel tells the platform:

• Who clicked
• Who converted
• What actions they took
• Which ad drove the result

No pixel = Meta has NO idea what success looks like.
Read 6 tweets
Jan 31, 2024
Master React for FREE.

Build 70+ React Projects: 🧵
1. 5 Top-Notch Projects to learn React
youtube.com/playlist?list=…
2. Code 15 React Projects - Complete Course
Read 7 tweets
Dec 30, 2023
Master React for FREE.

Build 70+ React Projects: 🧵 Image
1. 5 Top-Notch Projects to learn React
youtube.com/playlist?list=…
2. Code 15 React Projects - Complete Course
Read 7 tweets
Dec 28, 2023
HTML & CSS in 50 Days: Image
Days 1-5: HTML Basics

➔ Introduction to HTML
• What is HTML?
• HTML Syntax
• Elements and Tags

➔ Basic HTML Structure
• Head, Body, Title
• Paragraphs, Headings

➔ Project:
• Simple Personal Bio Page
Days 6-10: HTML Intermediate

➔ Links and Images
• Internal, External, Anchor Links
• Adding Images, Alt Text

➔ Lists and Tables
• Ordered, Unordered, Nested Lists
• Basic Table Structure

➔ Project:
• Simple Blog Page
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(