Posts in technical

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.

Type Inference and Annotations in TypeScript

Learn how TypeScript infers values and when annotations help in React props and event handlers, with practical examples, pitfalls, and runtime safety notes.

Union Types and Narrowing for React UI States

Learn how TypeScript union types model React loading, success, and error states, with discriminated unions, safe narrowing, and practical failure handling.