The Official ReScript Bindings for ReactJS
- Existing users want to upgrade from
reason-react@0.9
torescript-react@0.10
(should be a smooth transition, check out the CHANGELOG.md for minor breaking changes) - Make sure that all community libraries that are still on
reason-react
publish a new@rescript/react
version as well (for compatibility reasons) - We will soon publish our
v1.0
changes, with a newreact-jsx
version and some other cool features! Check out our RFC post for more infos.
The ReScript compiler V10.1+ is required.
npm install @rescript/react --save
In your bsconfig.json
:
{
"jsx": { "version": 4, "mode": "classic" },
"bs-dependencies": ["@rescript/react"]
}
If you want to try the new jsx transform which was introduced in React v17, set the "mode": "automatic"
.
If you want to try build your project with JSX v3, see the V3 compatibility mode
Quick Links:
-
v0.11.0+
- ReScript Compiler v10.1+
- ReactJS v18.0.0+
-
v0.10.3
- bs-platform v8.3+
- ReactJS v16.8.1+
- Optimized for ReScript syntax usage
npm install
# Starts the ReScript compiler in watchmode
npm start
This project is the next evolution of the original reason-react bindings.