Introduction
ReScript offers first class bindings for ReactJS and are designed and built by people using Reason and React in large, mission critical production React codebases. The bindings are compatible with all React versions > 16.8 (the version that initially introduced React hooks).
The ReScript philosophy is to compile as closely to idiomatic JS code as possible; in 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 straightorward to integrate with existing ReactJS codebases and libraries.
All our documentated examples can be compiled in our ReScript Playground as well.
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.
Note about the wording:
The React bindings are officially called ReasonReact due to legacy reasons. The name will eventually be adapted in the future. For simplicity reasons, we try to stick either to ReScript & React
, React bindings
or just React
.
Feature Overview
No Babel plugins needed (JSX is part of the language!)
Bindings for all important React APIs needed to build production ready apps (
useState
,useReducer
,useEffect
,useRef
,...)No class based component API legacy (all ReasonReact codebases are built on functional components & hooks)
Strong level of type safetiness and type inference for component props and state values
GenType support for importing / exporting React components in Flow and TypeScript codebases
Development
In case you are having any issues or if you want to help us out improving our bindings, check out our ReasonReact Github repository.
For doc related issues, please go to the rescript-lang.org repo.