reason-react
Advanced tools
Changelog
0.5.0
This release requires bs-platform 4.0.3
.
Small breaking change (only if you haven't upgraded for a while). The migration/upgrade script, as always, is here.
ReactEventRe
is now deprecated in favor of ReactEvent
. They're similar but the latter comes with the big quality-of-life improvement of turning our old:
ReactDOMRe.domElementToObj(ReactEventRe.Form.target(event))##value
into:
event->ReactEvent.Form.target##value
Aka, you can use the ->
fast pipe now (|.
in OCaml syntax), and we've changed the definition of target
in the various ReactEvent
modules to directly give you back a Js.t
object instead of Dom.element
. Same applies to other such attributes.
We've also changed things like ReactEventRe.Mouse._type
into ReactEventRe.Mouse.type_
to abide by the Reason idiom.
Lastly, bs.send.pipe
is informally deprecated, so we've removed the usage of those too. Instead of e |> ReactEventRe.Mouse.preventDefault
, use either e->ReactEvent.Mouse.preventDefault
or ReactEvent.Mouse.preventDefault(e)
. bs.send.pipe
is, all things considered, the heaviest BuckleScript special annotation. If your library uses it, please consider removing it too. Thanks!
Fragment has landed! <> child1 child2 </>
. For more info, check ReactJS' docs on Fragment. Note that we currently don't support:
<> ...children </>
.The latter will be supported next. Fragment requires React 16.
Additionally, DOM component children spread <div>...foo</div>
now works. No more need to use the ReasonReact.createDomElement
fallback!
_type
, _open
, and others (see 0.4.2 release notes below) are officially removed. Use type_
, open_
, etc.subscriptions
was deprecated and is now removed completely. Please use the new subscriptions helper instead.ReasonReact.stringToElement
, nullElement
, arrayToElement
are also gone for good. Use ReasonReact.string
, null
, array
. The previous migration script in 0.4.0
already took care of this.ReasonReact.Callback
module removed.ReasonReact.createDomElement
is changed in favor of ReactDOMRe.createElementVariadic
. This is more consistent with ReactDOMRe.createElement
. Both are used by the JSX transform; the latter, when it's a children spread for DOM elements (mentioned above) and has a small perf cost.Thanks for the wait, and enjoy!
Changelog
0.4.2
This release requires bs-platform 3.1.4
.
aria-*
attributes without needing hacks: <div ariaLabel="foo" />
. The camelCase ariaStuff
will compile to aria-stuff
._open
, _type
, _begin
, _end
, _in
, _to
, use the new trailing underscore version for consistency: open_
, type_
, etc. The former leading underscore versions are now deprecated.Changelog
0.4.1
ReasonReact.Callback
module for now and put a deprecation warning on it. This way, at least your third-party dependencies can compile further.wrapJsForReason
and wrapReasonForJs
types so that we can use bs.abstract
for interop instead of Js.t
objects.Changelog
0.4.0
Requires bs-platform >=3.0.0
. Migration script is here.
SilentUpdate
and SilentUpdateWithSideEffects
. These aren't used for a long time now.didMount
now returns unit
, per our previous warnings in the docs. To trigger a state update, use self.send(MyAction)
.self.reduce
for real; use self.send
(not to be confused with reducer
, which is still around).ReasonReact.Callback
module (undocumented and unused).ReasonReact.stringToElement
, arrayToElement
and nullElement
are now deprecated in favor of ReasonReact.string
, array
and null
!subscriptions
API is deprecated. Please use the new self.onUnmount
.willReceiveProps
deprecated. We'll transition to React 16 very soon and release our binding to deriveStateFromProps
.bool
instead of Js.boolean
(thanks to BuckleScript 3.0.0).ReasonReact.stringToElement
is now ReasonReact.string
, etc.?Changelog
0.3.4
This release requires bs-platform 2.2.2! If your app haven't upgraded to it, don't worry; you can still use ResonReact 0.3.2 just fine. Only two small changes.
Js.Nullable.toOption
. No more deprecation warnings when you use ReasonReact (main purpose of the release).ReactDOMRe.hydrate
, hydrateToElementWithId
, hydrateToElementWithClassName
(#184).Changelog
0.3.2
Router.dangerouslyGetInitialUrl
. Please see the corresponding docs on router.Changelog
0.3.1
No breaking change. The migration script is here.
self.reduce
is now changed into self.send
, with a simpler semantic that clears up the confusion on the immediate call case. More performant and fewer allocations too! The migration script will convert most of the code over for you.Before: onClick={self.reduce(_event => Click)}
After: onClick={_event => self.send(Click)}
Before: didMount: self => {self.reduce(() => Click, ()); NoUpdate}
After: didMount: self => {self.send(Click); NoUpdate}