React Basics – Easy Study Notes for Beginners

📘 What is React?

React is a JavaScript library used to build user interfaces, especially for websites and web apps.


📘 Why use React?

  • Fast performance

  • Reusable components

  • Easy to manage UI

  • Strong community support


📘 What is a Component?

A component is a small part of the UI.
It can be reused again and again.

👉 Example: Navbar, Button, Card


📘 Types of Components

1. Functional Component

  • Simple function

  • Most commonly used

2. Class Component

  • Older method

  • Uses classes


📘 What is JSX?

JSX is a syntax that looks like HTML but works inside JavaScript.

👉 Example:
<h1>Hello World</h1>


📘 What is State?

State is used to store data inside a component.
It can change over time.


📘 What are Props?

Props are used to pass data from one component to another.


📘 React Hooks

useState

  • Used to manage state

useEffect

  • Used for side effects like API calls


📘 Advantages of React

  • Fast rendering

  • Easy to scale

  • Code reuse

  • Large ecosystem


📘 Disadvantages

  • Learning curve for beginners

  • Needs extra tools


🔁 Flashcards (Study Mode)

Q: What is React?
A: A JavaScript library for building UI

Q: What is a component?
A: A reusable part of UI

Q: What is JSX?
A: HTML-like syntax in JavaScript

Q: What is state?
A: Data stored inside a component

Q: What are props?
A: Data passed between components

Q: Name two React hooks
A: useState, useEffect