DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact

Syntax Lookup

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

The @send decorator is used to bind to a method on an object or array.

Example

ReScriptJS Output

// Bind to a method on an object
type document
@send external getElementById: (document, string) => Dom.element = "getElementById"
@val external doc: document = "document"
let el = getElementById(doc, "myId")

// Bind to a method on an array
@send external fillInPlace: (array<'a>, 'a) => array<'a> = "fill"
let a = fillInPlace([1, 2, 3], 99)

References

  • Bind to JS Function

© 2025 The ReScript Project

About
  • Community
  • ReScript Association
Find us on