Syntax Lookup

Enter some language construct you want to know more about.
This is the @deprecated decorator.

The @deprecated decorator is used to add deprecation notes to types, values and submodules. The compiler and editor tooling will yield a warning whenever a deprecated entity is being used.

Alternatively, use the @@deprecated decorator to add a deprecation warning to the file level.

Examples

ReScriptJS Output
@deprecated
type person = {id: int, name: string}

@deprecated
let customDouble = n => n * 2

@deprecated("Use OtherModule.customTriple instead")
let customTriple = n => n * 3

@deprecated("Use OtherModule instead")
module MyModule = {
  type t
}