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 value assignment operator.

This operator assigns a new value to a ref.

ReScriptJS Output
let total = ref(0)
total := 1

A ref is a builtin record type with a mutable contents field. Therefore the := operator is just a shorthand version for the following code:

ReScriptJS Output
let total = ref(0)
total.contents = 1

© 2025 The ReScript Project

About
  • Community
  • ReScript Association
Find us on