BuckleScript & Reason are now called ReScript, therefore the ReasonReact bindings will now be known as ReScript / React and need to be moved to a different npm package.
reason-reactnpm package will now be published as
email@example.com basically a cleaned up version of
firstname.lastname@example.org(see the CHANGELOG for minor breaking changes).
reason-reactgithub repository will be archived. Please refer to our new repository at github.com/rescript-lang/rescript-react.
- The next upcoming
@rescript/reactrelease will come with a few cool new features! Check out our RFC discussion for more infos.
From an API perspective, upgrading from
@rescript/react should be very easy, since most changes are a just matter of doing a few global search & replaces.
Details for the changed APIs can be found in our revamped ReScript / React migration guide.
Important: All Libraries need to be upgraded to
@rescript/react based projects are not compatible with libraries that depend on the old
reason-react package due to dependency conflicts.
In other words: If you try to compile a project that uses both,
reason-react, the compiler will not compile due to a
React module name collision.
There are currently three strategies to deal this issue:
- As a temporary workaround, use a patching tool like
npm patch-packageto adjust the package dependencies of indidvidual bindings to
- Ask the maintainer of your outdated third-party library to create a new major version release with
@rescript/reactas a dependency (don't forget to mention which version supports
@rescript/reactin the README).
- Or as a third alternative, create an updated fork of the project, or copy the bindings directly in your ReScript project.
For more details on the name collision issue, please refer to this forum post.
We apologize for the inconvenience; we promise that the migration work will be worth it!
If you have any questions or migration issues, please open a discussion on the ReScript Forum to get support, or ping @ryyppy / @rickyvetter on Github.
Thanks for being part of the ReasonReact community and see you on the ReScript side!