WebnD Inventory
React logo

React

Build interactive user interfaces with components, props, state, hooks, routing, and full-stack data flow.

All Concepts42 concepts

React Fundamentals

5 min

React is a JavaScript library for building user interfaces out of small, reusable components. Instead of finding DOM nodes and changing them by hand, you describe what the UI sh...

react·#react·#fundamentals
Read

JSX

5 min

JSX is a syntax extension that lets you write HTML-like markup inside JavaScript. It is not HTML: a build tool (Vite/Babel) compiles every JSX tag into a plain JavaScript functi...

react·#react·#jsx
Read

Components

4 min

A component is a JavaScript function that returns JSX. Components are the building blocks of every React app: you split the UI into small pieces (a Navbar, a ProductCard, a Butt...

react·#react·#components
Read

Props

4 min

Props (short for properties) are how a parent component passes data to a child. They work like function arguments: the child receives one object and reads values from it. Props ...

react·#react·#props
Read

State and useState

5 min

State is data that a component remembers between renders and that, when changed, makes React render the component again. You create it with the useState hook, which returns the ...

react·#react·#state
Read

Events

4 min

React lets you respond to user actions (clicks, typing, submits) by passing a function to an event prop like onClick. React wraps the browser event in a consistent object and ha...

react·#react·#events
Read

Conditional Rendering

4 min

Conditional rendering means showing different UI depending on state or props. In React you use plain JavaScript - if, the ternary operator ? :, and && - to decide what a compone...

react·#react·#conditional
Read

Lists and Keys

5 min

To show a collection of data, you transform an array into an array of JSX elements with .map(). Each element in the list needs a stable, unique key so React can tell which item ...

react·#react·#lists
Read

Forms and Controlled Components

5 min

In React, form inputs are usually controlled: their value lives in state, and every keystroke updates that state through onChange. React is then the single source of truth, whic...

react·#react·#forms
Read

useEffect

5 min

useEffect lets a component synchronize with something outside React after it renders: fetching data, adding event listeners, starting timers, changing the document title, or tal...

react·#react·#useeffect
Read

useRef

5 min

useRef gives you a mutable box (ref.current) that survives re-renders without causing one. It has two main jobs: holding a reference to a DOM element (to focus an input or scrol...

react·#react·#useref
Read

useContext

5 min

Context lets a parent make a value available to every component below it, without passing it as a prop through each level ("prop drilling"). You create a context, wrap part of t...

react·#react·#usecontext
Read

Lifting State Up

5 min

When two components need the same changing data, you cannot pass it sideways between siblings. Instead you move the state to their closest common parent and pass it down as prop...

react·#react·#lifting
Read

Component Communication

4 min

React components talk to each other in a few well-defined ways. Data goes down from parent to child through props, and information goes up through callback functions that the pa...

react·#react·#component
Read

Data Fetching in React

5 min

Most real apps load data from an API. In React you fetch inside an effect (or an event handler), store the result in state, and render based on three situations: loading, error ...

react·#react·#data
Read

Advanced Data Fetching

5 min

Basic useEffect fetching works, but real apps hit extra problems: requests that finish out of order, requests for components that already left the screen, repeated loading of th...

react·#react·#advanced
Read

React Router

5 min

React is a Single Page Application library: the page never fully reloads. React Router is the standard library that maps URLs to components, so /products shows one component and...

react·#react·#router
Read

Search, Filter and Sort

4 min

Search, filter and sort are among the most common features in real React apps. The key idea: keep the original data and the user's choices (search text, selected category, sort ...

react·#react·#search,
Read

Persisting State with localStorage

4 min

React state disappears when the page is refreshed. The browser's localStorage stores small strings that survive reloads, so you can use it to remember a theme, a cart or a draft...

react·#react·#persisting
Read

Protected Routes and Auth UI

6 min

Authentication in React is about the user interface: tracking who is logged in, showing the right buttons and redirecting guests away from private pages. The real security check...

react·#react·#protected
Read

Custom Hooks

5 min

A custom hook is a JavaScript function whose name starts with use and that calls other hooks. It lets you extract and reuse stateful logic (not UI) between components: fetching,...

react·#react·#custom
Read

useReducer

5 min

useReducer is an alternative to useState for complex state where many different actions update related values. You write one pure reducer(state, action) function that describes ...

react·#react·#usereducer
Read

State Management

5 min

"State management" is deciding where each piece of state lives and how components share it. Start simple: keep state local, lift it when siblings need it, use Context for app-wi...

react·#react·#state
Read

React.memo

4 min

By default, when a component re-renders, all its children re-render too, even if their props did not change. React.memo wraps a component so React skips re-rendering it when its...

react·#react·#react.memo
Read

useMemo

4 min

useMemo caches the result of a calculation between renders and only recalculates it when its dependencies change. It helps in two cases: skipping an expensive computation, and k...

react·#react·#usememo
Read

useCallback

4 min

Every render creates new function objects. useCallback returns the same function reference between renders as long as its dependencies do not change. This matters when the funct...

react·#react·#usecallback
Read

Performance Optimization

5 min

Most React apps are fast enough without special effort. Optimize after measuring, and start with the biggest wins: avoid unnecessary work, render less, load less code and keep s...

react·#react·#performance
Read

Error Boundaries

5 min

If a component throws an error while rendering, React unmounts the whole tree and the user sees a blank page. An error boundary is a component that catches rendering errors in i...

react·#react·#error
Read

Loading, Empty and Error States

5 min

Any screen that shows data can be in more than one situation: loading, error, empty (no results) or success. Good React UIs plan for all of them so users never see a blank page ...

react·#react·#loading,
Read

Lifecycle and Rendering

5 min

A function component goes through three phases: mount (first appears), update (re-renders because state, props or context changed) and unmount (removed). Understanding how React...

react·#react·#lifecycle
Read

StrictMode

4 min

<StrictMode> is a development-only wrapper that helps you find bugs early. In development it renders components an extra time and runs each effect's setup and cleanup an extra t...

react·#react·#strictmode
Read

Accessibility in React

4 min

Accessibility (a11y) means everyone can use your app, including people who use a keyboard only, screen readers or high zoom. Most accessibility comes from writing semantic HTML ...

react·#react·#accessibility
Read

Styling in React

4 min

React does not force a styling method. You can use plain CSS files, CSS Modules (locally scoped class names), inline style objects, utility CSS like Tailwind, or CSS-in-JS libra...

react·#react·#styling
Read

Project Setup with Vite

5 min

Create React App is deprecated; the standard way to start a new React project is Vite, a fast build tool with instant dev server startup and optimized production builds. This to...

react·#react·#project
Read

Project Architecture

5 min

As a React app grows, a clear folder structure keeps it easy to read and change. There is no official layout; good structures follow a few ideas: group files by feature, keep re...

react·#react·#project
Read

Reusable Components and Composition

4 min

React favours composition over inheritance: build complex UIs by combining small components and letting parents decide what goes inside through children and props. A good reusab...

react·#react·#reusable
Read

React Design Patterns

5 min

Design patterns are proven ways of structuring components and logic. Today the most useful ones are custom hooks (reuse logic), composition (reuse UI), compound components (rela...

react·#react·#design
Read

DevTools and Debugging

5 min

Debugging React means finding out why the UI differs from what you expect. Your tools are the browser console, the React Developer Tools extension (Components and Profiler tabs)...

react·#react·#devtools
Read

Testing React

5 min

Tests prove that components behave correctly and keep working after changes. The modern approach uses Vitest (or Jest) as the test runner and React Testing Library to render com...

react·#react·#testing
Read

CRUD in React

6 min

CRUD stands for Create, Read, Update, Delete, the four actions almost every data-driven interface needs. In React you keep the list in state, call an API (or a mock like json-se...

react·#react·#crud
Read

Modern React (React 19)

6 min

React 19 made common tasks simpler: forms can use Actions, pending/optimistic UI have dedicated hooks, ref is a normal prop, and a use API reads promises and context. The React ...

react·#react·#modern
Read

Professional React Practices

5 min

Professional React code is not about clever tricks; it is about clear, predictable, maintainable code. This topic collects the habits that separate a beginner project from produ...

react·#react·#professional
Read