Mohammed Junaid Profile picture
Sep 9 β€’ 12 tweets β€’ 3 min read Twitter logo Read on Twitter
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

Sep 9
R.I.P. Video Editors.

AI can create videos instantly.

Introducing @morphaistudio (It's free):
@morphaistudio @morphaistudio is a game-changer!

It's a free AI tool that lets you create stunning videos in mere seconds.

Join their Discord server to start generating videos instantly!

Link here: discord.gg/UVNAJGxFNy
@morphaistudio Step 1 - Join the Discord Server πŸ‘Ύ

Navigate to this Discord link: .

Join the server, you're one step closer to creating your own videos! discord.gg/UVNAJGxFNy
Read 8 tweets
Sep 8
Learn React in 30 Days.

Complete Structure:
Pre-Requisite:

Javascript Before React - Content Added. Image
Week 1: Introduction and Basics Image
Read 9 tweets
Sep 7
Master Data Structures & Algorithms for Free:
1. Large blue diamond Intro to Algorithms - Udacity

udacity.com/course/intro-t…
2. Data Structures and Algorithms Specialization

coursera.org/specialization…
Read 7 tweets
Sep 6
Master HTML & CSS in 50 Days:
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
Sep 2
Master Javascript.

Build 85 Projects Using JavaScript.

Thread:
1. Build 15 JavaScript Projects - Vanilla JavaScript Course.

2. 10 JavaScript Projects in 10 Hours - Coding Challenge πŸ”₯

Read 7 tweets
Aug 27
React Roadmap - The Ultimate 2023 Guide:
1. Setting the Stage:

βž” JavaScript ES6+:

β€’ Understand arrow functions
β€’ Destructuring
β€’ spread/rest operator
β€’ async/await

βž” Node & NPM:

Basic understanding and using Create React App (CRA).
βž” The React Philosophy:

β€’ Declarative programming
β€’ Component-based architecture.

2. Diving into the Basics:

βž” Virtual DOM:

βž” React Elements vs. Components

βž” Functional Components

βž” JSX Deep Dive
Read 32 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 on Twitter!

:(