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
rescript-react
Overview
  • Introduction
    • Feature Overview
    • Development
  • Installation
  • Migrate from JSX v3
Main Concepts
  • Elements & JSX
  • Rendering Elements
  • Components and Props
  • Arrays and Keys
  • Refs and the DOM
  • Context
  • Styling
  • Router
Hooks & State Management
  • Hooks & State Management Overview
  • useEffect Hook
  • useState Hook
  • useReducer Hook
  • useContext Hook
  • useRef Hook
  • Build A Custom Hook
Guides
  • Beyond JSX
  • Forwarding Refs
  • Extensions of props
Docs / rescript-react / Introduction
Edit

ReScript & React

ReScript offers first class bindings for ReactJS and is designed and built by people using ReScript and React in large mission critical React codebases. The bindings are compatible with modern React versions (>= v18.0).

The ReScript philosophy is to compile as closely to idiomatic JS code as possible; in the case of ReactJS, we made no exception, so it's not only easy to transfer all the React knowledge to the ReScript platform, but also straightforward to integrate with existing ReactJS codebases and libraries.

All our documented examples can be compiled in our ReScript Playground as well.

Feature Overview

  • No Babel plugins required (JSX is part of the language!)

  • Comes with all essential React APIs for building production ready apps (useState, useReducer, useEffect, useRef,...)

  • No component class API (all ReScript & React codebases are built on function components & hooks)

  • Strong level of type safety and type inference for component props and state values

  • GenType support for importing / exporting React components in TypeScript codebases

This documentation assumes basic knowledge about ReactJS.

Please note that even though we will cover many basic React concepts, it might still be necessary to have a look at the official ReactJS resources, especially if you are a complete beginner with React.

Development

  • In case you are having any issues or if you want to help us out improving our bindings, check out our rescript-react GitHub repository.

  • For doc related issues, please go to the rescript-lang.org repo.

Installation

© 2024 The ReScript Project

Software and assets distribution powered by KeyCDN.

About
  • Community
  • ReScript Association
Find us on