Posts tagged with #react

React Custom Hooks for Reusable Stateful Logic

Learn how React custom hooks reuse stateful logic, follow use* naming and call rules, type inputs and results, and keep each call's state independent.

React Router Fundamentals: Routes, Links, and Params

Learn how React Router matches URLs to screens, navigates with links, reads dynamic parameters, and organizes shared layouts and route loading states.

React State with useState and TypeScript

Learn how useState snapshots work, how TypeScript infers state types, and how to update objects and arrays immutably in React components.

Sharing State and Lifting State Up in React

Learn when sibling React components need shared state, how to lift it to their nearest common owner, and why local state often beats global state.

Styling React Components and Importing Assets

Compare plain CSS with CSS modules, then learn how Vite handles imported files and public assets in React projects, with practical code examples.

Typed Function Components in React and TypeScript

Learn to type React function component props, understand inferred return types, handle optional values safely, and compose small components with confidence.

TypeScript Functions and Generics for React Code

Type callback and event handlers, use inference well, and build reusable React helpers and components with TypeScript generics and safe constraints.

Nullable and Unknown Data in TypeScript Interfaces

Learn to model optional and nullable fields, narrow unknown values, and safely parse API or storage data in React with strict TypeScript checks.

Objects, Arrays, and Interfaces in TypeScript

Learn how TypeScript models objects and arrays, when to use interfaces, and how to type React props while keeping untrusted runtime data safe.