TypeScriptWorking with JavaScript & Type Declarations

68 items

1

Optional Props and Literal Union Props in Components

Quiz
2

Optional Props and Literal Union Props in Components

Flashcard
3

Typing useRef: Nullable Element Refs

Flashcard
4

Typing a React onChange Handler

Code Quiz
5

Typing useState & Event Handlers

Quiz
6

Typing React Props, Hooks & Events

Slides / Video
7

Typing React Props, Hooks & Events

Flashcard
8

Typing React Props, State & Events

Slides / Video
9

Typing React Props, State & Events

Flashcard
10

Typing React Props Correctly

Code Quiz
11

Typing React Props with Interfaces

Quiz
12

Typing React Props & State

Slides / Video
13

Typing React Props & State

Flashcard
14

Module Augmentation Basics

Flashcard
15

JSDoc @typedef Property Syntax

Code Quiz
16

Misplaced @ts-ignore Directive

Code Quiz
17

Module Augmentation Basics

Slides / Video
18

Type-Checking JS with allowJs and checkJs

Slides / Video
19

Generating Declaration Files Automatically

Slides / Video
20

Writing Declaration Files for Untyped Libraries

Slides / Video
21

Installing @types from DefinitelyTyped

Slides / Video
22

Ambient Modules and Global Declarations

Slides / Video
23

The declare Keyword for Ambient Declarations

Slides / Video
24

What Declaration Files Are

Slides / Video
25

esModuleInterop for JS Interop

Slides / Video
26

typeRoots and types Configuration

Slides / Video
27

TypeScript Check Comments Explained

Slides / Video
28

Gradual Migration to TypeScript

Slides / Video
29

JSDoc Type Annotations in JavaScript

Slides / Video
30

JSDoc Type Annotations

Quiz
31

Gradual JS to TS Migration

Quiz
32

declare namespace Usage

Quiz
33

@ts-check and @ts-nocheck

Quiz
34

Typing the global Object

Quiz
35

Ambient Variable and Function Declarations

Quiz
36

Automatic Type Acquisition

Quiz
37

@param and @type Precision

Quiz
38

The declare Keyword

Quiz
39

@ts-ignore vs @ts-expect-error

Quiz
40

Purpose of Declaration Files

Quiz
41

Declaring Untyped Modules

Quiz
42

Installing @types Packages

Quiz
43

UMD Global Declaration Syntax

Code Quiz
44

Implicit any from JS Import

Code Quiz
45

JSDoc @type Annotation

Code Quiz
46

JSDoc @param and @returns

Code Quiz
47

Overloaded Signatures in .d.ts

Code Quiz
48

Ambient const enum

Code Quiz
49

Value Inside a .d.ts File

Code Quiz
50

Triple-Slash Reference Syntax

Code Quiz
51

Ambient Variable with declare

Code Quiz
52

Ambient Class Shape

Code Quiz
53

Installing @types Packages

Code Quiz
54

declare namespace Members

Code Quiz
55

Ambient Function Signature

Code Quiz
56

@ts-check and @ts-nocheck

Flashcard
57

Installing @types Packages

Flashcard
58

Structure of an @types Package

Flashcard
59

The declare Keyword

Flashcard
60

Handling Implicit any

Flashcard
61

Wildcard Module Declarations

Flashcard
62

Gradual JS to TS Migration

Flashcard
63

JSDoc for Typing JavaScript

Flashcard
64

@ts-ignore vs @ts-expect-error

Flashcard
65

Ambient Functions

Flashcard
66

Triple-Slash Directives

Flashcard
67

Global Augmentation with declare global

Flashcard
68

Ambient Global Variables

Flashcard
FlashcardIntermediate

Typing useRef: Nullable Element Refs

DOM element refs are typed as nullable and initialized with null.

Question

How do you type a `useRef` that points to a DOM element?

Click to reveal answer