ReasonReact is back (and powered by Melange)
ReasonReact moved to @rescript/react
after the ReScript announcement. The future of ReasonReact has been uncertain ever since. In the meantime, the Melange team announced the first major release of Melange and took the first steps towards deeper integration with the OCaml ecosystem.
Today, we are happy to announce that ReasonReact is back and will be maintained by the Melange team going forward.
What's changing?
We released ReasonReact to the opam repository. In the Melange docs, we document how to depend on packages in opam.
We updated the documentation to reflect these new changes and we will continue to improve it over time.
Adopting ReasonReact
To use ReasonReact, you must be using Melange. Get started here.
Next:
- Install the latest version of ReasonReact:
opam install reason-react
- In your dune file, add
reason-react
tolibraries
and preprocess withreactjs-jsx-ppx
:
(libraries reason-react) (preprocess (pps react-jsx-ppx))
- Replace any previously deprecated modules with their new names:
ReactDOMRe
->ReactDOM
,ReactEventRe
->ReactEvent
,ReasonReact
->React
. - Remove any usage of
ReasonReactCompat
andReasonReactOptimizedCreateClass
. These have long been deprecated, and have been removed in this version.
Future
We started moving all ReasonReact related packages to Melange and 0.11 and want to make sure the ReasonML community can update the 3rd party libraries to use Melange as well.
Some of them are published in github.com/melange-community or github.com/ahrefs. Examples include melange-react-dates or melange-recharts.
There's lots to do for the next version. We are committed to continue improving ReasonReact and make it a great library for the Melange and ReasonML community. In the future, we expect to make the following changes:
- Track
reacjs-jsx-ppx
in this repository, and rename it toreason-react-ppx
, a more suitable name - Use the new JSX transform from React 17
- Fix code-generation locations for JSX and props
- Continue improving the documentation
Feel free to reach out if you have any feedback. You can open an issue in this repository, or join the ReasonML Discord.
Full changelog
The version of ReasonReact published to npm is compatible with ReScript 0.9.0. Since then, we've fixed a few things:
- [0.9.2] Add drag event API binding
- [0.9.2] Add
aria-haspopup
as ariaHaspopup as prop - [0.9.2] Add
aria-current
as ariaCurrent as prop - [0.9.2] Add
aria-checked
as ariaChecked as prop - [0.10.0] Deprecate legacy modules (ReasonReact, ReasonReactCompat, ReasonReactOptimizedCreateClass)
Version 0.11
- [0.11.0] Add suppressHydrationWarning
- [0.11.0] Created opam package (reason-react.opam)
- [0.11.0] Requires dune 3.8.0 (via dune-project)
- [0.11.0] Full migration to Melange
Have a good day!