ReScript HomeReScript Home
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 ref mutable reference syntax.

Use ref(value) to create a mutable reference cell. Read via .contents and update via :=.

Example

ReScriptJS Output
let counter = ref(0)

counter := counter.contents + 1

References

  • Mutation

© 2026 The ReScript Project

About
  • Community
  • ReScript Association
Find us on