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 @val decorator.

The @val decorator allows you to bind to JavaScript values that are on the global scope.

Example

ReScriptJS Output
type timeoutID

@val
external setTimeout: (unit => unit, int) => timeoutID = "setTimeout"

let timeoutID = setTimeout(() => Console.log("Hello"), 1000)

References

  • Bind to Global JS Values

© 2025 The ReScript Project

About
  • Community
  • ReScript Association
Find us on