NUS Hackers Wiki
NUS Hackers Wiki
  • NUS Hackers Wiki
  • Hackerschool
    • Virtual Machines and Linux
    • Beginners' Guide to the Terminal
      • Introduction to the Terminal
      • Modern Shell Tools
      • Shell Scripting
      • Real World Scripting
      • Resources
    • Self-Hosting: Three Easy Pieces
      • 1. Setting up your server
      • 2. Running Services
      • 3. Monitoring your server
    • Vim
    • Introduction to Zig
      • Language Basics
      • Error Handling
      • Memory Management
      • Working with C
      • Exploring comptime
    • CI/CD with Github Actions
      • Background
      • Basics of Github Actions
        • Target workflow
        • Running unit tests
        • Linting code
        • Deploying to Github Pages
      • Advanced use cases
        • Pollers
        • Github script
        • Executing third-party scripts
        • Reusable workflows
      • Cookbook
    • Lightning Git
      • Git Concepts
      • Getting Started with Git
      • Making your first commit
      • Branching
      • Merge Conflicts
      • Integrating remote repositories
      • Collaborative Workflows
      • Commit Manipulation and Reflog
      • Interactive rebasing
      • filter-repo
  • Orbital
    • JavaScript
      • Browser Developer Tools
      • Getting Started
      • Datatypes
      • Operators and Operations
      • Loops and Conditions
      • Functions
      • Strings
      • Arrays
      • HTML
        • Getting Started
        • Tag Attributes
        • HTML Forms
        • Browser Inspector
      • CSS
        • Selectors
        • Colors in CSS
        • Measurements in CSS
        • The Box Model
        • Adding Styles - Part 1
        • Adding Styles - Part 2
      • Working with the DOM
        • Querying the DOM - Selectors
        • Querying the DOM - Element Attributes
        • Querying the DOM - Element Styles
        • Events with JS and HTML
        • Exercise: Click Counter
        • Editing the DOM
        • Fetch Requests
        • Exercise: The NUSMods API
    • React
      • Setup
      • State
    • React Native
      • Setup
      • Intro to JSX
      • Basic Syntax
      • Handling UI
      • Props
      • State Management
    • Git
      • Setup
      • Command Glossary
      • Fundamental Concepts
        • Getting Started
        • Integrating Remote Repositories
        • Branching
        • Merge Conflicts
      • Collaborative Workflows
        • Fork and PR Workflow
        • Branch and PR Workflow
      • Advanced Concepts
        • Ignoring Files
        • Commit Message Conventions
        • Github Collaborators
        • CI/CD with Github Actions
        • Advanced Git Commands
      • FAQ
    • Telegram Bot
      • Creating a TeleBot
      • API Calls
      • Telebot Basics
      • Integrating API's
    • Relational Database
      • Database Overview
      • Database Design
      • Entity Relationship Diagram
      • SQL Basics & PostgreSQL
    • TypeScript
      • Types and Interfaces
      • Utility Types
      • Typing Component Props, Events, and Hooks
      • Why You Should Avoid Using any (and What to Do Instead)
      • TypeScript Tricks You’ll Use All the Time in React
Powered by GitBook
On this page
  • What is TypeScript?
  • What This Guide Covers
Edit on GitHub
Export as PDF
  1. Orbital

TypeScript

PreviousSQL Basics & PostgreSQLNextTypes and Interfaces

Last updated 3 days ago

What is TypeScript?

At its core, TypeScript is a superset of —which means it builds on top of JavaScript by adding static typing.

Think of it as

TypeScript = JavaScript + Types

You write valid JavaScript, but with the power of types, interfaces, type inference, and other features that help catch bugs earlier, improve editor tooling (like auto-completion and refactoring), and make your codebase more robust as it grows.

TypeScript compiles to JavaScript, which means your browser or Node.js doesn’t need to support TypeScript directly. You write .ts or .tsx files, then transpile them into plain JavaScript (usually sits under the /dist folder).

What This Guide Covers

This guide is for those who've finished the and want to learn just the most essential TypeScript features to be productive in React.

We’re not going to cover everything about TypeScript (like advanced conditional types). Instead, we focus on:

  • What you actually use daily in React codebases

  • Concepts that improve code clarity, type safety, and developer productivity

By the end of this guide, you'll understand how to:

  • How to define and extend types and interfaces for your components and logic

  • When and how to use handy utility types like Pick, Omit, and Partial

  • How to safely type component props, events, refs, and hooks

  • How to avoid common mistakes (like reaching for any too quickly)

  • And ultimately, how to make your code more predictable, scalable, and enjoyable to work with

JavaScript
JavaScript section