Skip to main content

TypeScript utils

Nullable

A type can be null and undefined.

Nullable<string>; // string | null | undefined

EffectTarget (React)

type EffectTarget<T> =
| Nullable<T>
| (() => Nullable<T>)
| { current: Nullable<T> };