reason-react
Advanced tools
Changelog
0.3.0
Technically a breaking change, but just because of the removal of a few deprecated things. No migration script this time; since the few breaking changes you encounter (if any) should have be spotted by the type system and fixed in a few secs anyway.
Improvements:
children
's restriction. This unlocks huge potentials. See the blog post!Breaking Changes:
ref
is now typed as Js.nullable(Dom.element)
, not Js.null(Dom.element)
. Js.nullable
is the new community idiom from BuckleScript. Go through your codebase and change your state.myRef := Js.Null.to_opt(theRef)
into state.myRef := Js.Nullable.to_opt(theRef)
. We suggest you to also remove all mentions of Js.null
, Js.undefined
, Js.Null
and Js.Undefined
. Js.Nullable
checks for both JavaScript null
and undefined
, thus making the JS interop more robust. In the past, people type certain values (especially js objects fields) as e.g. null
and forget they can be undefined
.ReactDOMRe
)'s open
, end
and in
attributes are now changed to _open
, _end
and _in
to avoid using reserved keywords. This is only breaking if you're using these attributes and are on the old syntax.enqueue
, statefulComponent
and self.update
. These have long been deprecated.Changelog
0.2.4
Major update, but again with no breaking changes, and again with a convenience migration script! =)
The big change in this release is the deprecation of statefulComponent
and statefulComponentWithRetainedProps
. statelessComponent
stays the same.
Changelog
0.2.1
Breaking update (sorry!)
We've finally removed ReactRe
. It's been deprecated since 0.1.4. And we've offered a comprehensive migration in the 0.1.4 section below.
We've given folks a bit of breathing room in terms of breaking changes; now we're shipping another one, this time with a small migration script. After installing reason-react, use node node_modules/reason-react/oldScriptCarefulMigrateFrom015To020.js myReasonFile.re
fun state self => ...
, we've now rolled state
into self
, and now, you have fun {state, handle} => ...
. The whole record is self
. Feel free to destructure and get whatever you need!self
now contains a new prop, retainedProps
. This is a new (non-breaking) feature that solves the previous slightly inconvenient way of forwarding props to state, as described in the old API's lifecycle methods. Now there's a dedicated API for it! The docs describes this in detail.Changelog
0.1.5
Non-breaking update. Works better with bs-platform >=1.8.0, which comes with the following ReasonReact JSX fixes:
ref=?foo
).Our own release contains the following improvements:
props
and style
to include more accurate DOM and style attributes and styles (#9, #15, #17).ReactDOMRe.Style.unsafeAddProp
to unsafely add a prop to an existing style
. Make sure you know what you're doing!reactRef
's type in various locations. A React ref is actually always nullable; we've previously only acknowledged it for DOM ref, now we do for custom (composite) components ref too. A more detailed explanation is here. This is documented in our docs in the ref section as well.cloneElement
(solves adding otherwise invalid keys like aria-label and data-foo).shouldUpdate
.Changelog
0.1.4
Major update! Though this is 100% backward compatible, so no major version bump. We've revamped the whole API based on all you awesome folks' feedback, and we've provided a gradual migration path.
Changelog
0.1.3
DOM ref is now typed as Js.null Dom.element
, instead of just Dom.element
(https://github.com/reasonml/reason-react/commit/6f2a75b). Trivial migration: https://github.com/reasonml-community/reason-react-example/commit/b44587a