Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
API
Introduction
  • Overview
Modules
  • Js Module
  • Belt Stdlib
  • Dom Module

You are currently looking at the v8.2 - v9.0 docs (Reason v3.6 syntax edition). You can find the latest API docs here.

Overview

ReScript ships 3 modules in its standard library.

  • Js: bindings for all your familiar JavaScript APIs.

  • Belt: extra collections and helpers not available in JavaScript.

  • Dom: Dom related types and modules.

Usage heuristics:

  • Default to using the Js module. Most of the APIs in it are runtime-free and compile down to clean, readable JavaScript, which is our priority.

  • For other APIs that aren't available in regular JavaScript (and thus don't exist in our Js bindings), use Belt. For example, prefer Js.Array2 over Belt.Array.

  • The Dom module contains our standardized types used by various userland DOM bindings. Due to the complexity of DOM, we don't mind that you ignore this module and build your application-specific DOM bindings.

Note: we do not recommend other userland standard library alternatives (unless it's DOM bindings). These cause confusion and split points for the community.

© 2024 The ReScript Project

Software and assets distribution powered by KeyCDN.

About
  • Community
  • ReScript Association
Find us on