cchakri.aiLearn All courses
// COURSE · FRONTEND

Frontend with React

Learn the browser foundations and React patterns needed to build responsive, testable user interfaces.

01

Browser and React foundations

Syllabus

  1. 01How the browser renders a page
  2. 02JSX and component structure
  3. 03Props and one-way data flow

Detailed content

How the browser renders a page

The browser parses HTML into a document tree, applies CSS rules, calculates layout, and paints pixels. JavaScript can update the document and respond to user events. Large scripts and expensive rendering block interaction. Understanding this path helps explain why semantic HTML, small updates, and responsive CSS improve both usability and performance.

JSX and component structure

JSX is syntax for describing a UI tree with JavaScript expressions. A React component is a function that returns that description. Split the page into components when they have a clear responsibility, useful reuse, or independent behavior. Keep markup readable and use semantic elements such as buttons, headings, forms, and navigation.

Props and one-way data flow

Props are inputs passed from a parent component to a child. Data flows downward, while callbacks let a child request that a parent update state. This makes ownership visible: the component that needs to coordinate a value should own it. Avoid copying props into state unless the component intentionally manages an editable draft.

02

State, events, and hooks

Syllabus

  1. 01State and event handling
  2. 02Effects and synchronization
  3. 03Forms and controlled inputs

Detailed content

State and event handling

State represents information that changes over time, such as a selected tab or form value. Updating state asks React to render the component again. Event handlers express user actions. Store the minimum information needed to derive the UI, and use functional updates when the next value depends on the previous one.

Effects and synchronization

Effects synchronize a component with something outside React, such as a browser subscription, timer, or network connection. They are not a general place to calculate values that can be derived during rendering. Declare dependencies accurately and clean up subscriptions so changes and unmounting do not leave stale listeners or duplicated work.

Forms and controlled inputs

A controlled input receives its displayed value from React state and reports edits through an event handler. This makes validation and conditional fields predictable. Validate at the boundary, show errors beside the relevant field, preserve user input after a failure, and provide labels and instructions that work with keyboard and screen-reader navigation.

03

Application data and navigation

Syllabus

  1. 01Fetching data and handling states
  2. 02Routing and page composition
  3. 03Reusable UI and design systems

Detailed content

Fetching data and handling states

A data-driven screen needs loading, success, empty, and error states. Cancel or ignore stale requests when the selected resource changes. Keep API response parsing and error handling consistent. Render useful progress feedback, and provide a retry or recovery action when a request fails instead of leaving a blank region.

Routing and page composition

A router maps a URL to a page and lets users move between related views. Use links for navigation and buttons for actions. Route parameters identify resources; query parameters can represent filters or pagination. Make each route work when loaded directly, preserve meaningful browser history, and show a clear not-found state for unknown resources.

Reusable UI and design systems

A component API should expose the choices a caller actually needs without leaking implementation details. Reuse stable patterns such as buttons, dialogs, and form fields, while keeping specialized sections local. Consistent spacing, color, focus, and interaction behavior make a product easier to learn and reduce one-off CSS.

04

Quality and production

Syllabus

  1. 01Accessibility and responsive interfaces
  2. 02Testing React interfaces
  3. 03Performance and release readiness

Detailed content

Accessibility and responsive interfaces

Use semantic landmarks, correct heading order, labels, visible keyboard focus, and accessible names. Ensure content works at narrow widths and with zoom. Do not communicate state with color alone. Test the page with keyboard-only navigation and a screen reader, and prefer native browser controls when they already provide the needed behavior.

Testing React interfaces

Unit tests are useful for focused logic; component tests verify visible behavior in response to user actions; end-to-end tests cover important journeys in a browser. Query controls by their accessible role or label. Test errors and empty states as well as the happy path, and avoid assertions tied to internal component structure.

Performance and release readiness

Measure user-visible performance before optimizing. Reduce unnecessary JavaScript, large images, and repeated network requests. Use stable keys for lists and avoid expensive work during rendering. Before release, check responsive layouts, error reporting, security-sensitive input handling, and the loading experience on a slower connection.