The full combined list of changes from v1.7.7 to v2.0.0 is here.
Contents:
- Changes in RC1
- Changes in RC2
- Changes in RC3
- Changes in RC4
- Changes in RC5
- Changes in between RC5 and 2.0.0 final
-
Bugfix in the
useCallbackWithDeps{,By}
hook -
Changed the pattern in hook signatures from
(mainArg: => A, deps: => D)
to(deps: D)(mainArg: D => A)
. Affected methods:useCallbackWithDeps{,By}
useEffectWithDeps{,By}
useLayoutEffectWithDeps{,By}
useMemo{,By}
-
Bugfixes:
- Expose default sync effect instead of internal type in:
SetStateFn(…)
ModStateFn(…)
ModStateWithPropsFn(…)
StateSnapshot
constructors should acceptSetStateFn
ModStateFn
ModStateWithPropsFn
TimerSupport.install
had an infinite loopTriStateCheckbox
'sonKeyDown
handler was callingevent.preventDefault()
on unhandled keys- Fix the Scala 3 version of
renderBackend
to support polymorphic backends (e.g.renderBackend[Backend[X]]
whereX
is a type already in scope) - Support
CallbackOption[Unit]
being passed directly to event handling vdom
- Expose default sync effect instead of internal type in:
-
Additions:
TriStateCheckbox
now accepts an optionalReusable[TagMod]
in itsProps
that will be applied to the<input>
- Add
.dispatch
toCallback
andAsyncCallback
which schedules (-and-forgets) the callback to be run in the background
-
Upgrade deps
- Cats-effect to 3.2.2
- Scala.js to 1.7.0
- Microlibs to 3.0.1
- UnivEq to 1.6.0
-
Support turning React warnings into runtime exceptions. There are a few ways to do this:
- Via a new config option for
ReactTestUtils
- Manually
- Via a new config option for
-
Document existing
debounce
methods to clarify you need to save them as aval
and reuse them -
Add:
AsyncCallback.debounce(duration): AsyncCallback[Unit]
Callback.debounce(duration): Callback
ScalaFnComponent.withReuse{,By}
ScalaFnComponent.withChildrenAndReuse{,By}
-
ReactTestUtils
is now atrait
as well as anobject
so that you can mix it into your own test utils collection -
Upgrade deps
- Cats-effect to 3.2.9
- Microlibs to 4.0.0
- Scala.js to 1.7.1
- scalajs-dom 2.0.0
- UnivEq to 2.0.0
- Add a new bundle called
core-bundle-cb_io
with provides core scalajs-react functionality withCallback
as the default sync effect andcats.effect.IO
as the default async effect. (Thanks @rpiaggio)
-
Add to callback module:
CallbackOption.suspend[A](f: => CallbackOption[A]): CallbackOption[A]
CallbackOption.traverse_
CallbackOption.sequence_
CallbackOption#finallyRun[B](runFinally: CallbackOption[B]): CallbackOption[A]
CallbackOption#when_
CallbackOption#unless_
-
Add to cats module:
- Implicit
MonadThrow
instances for scalajs-react effect types - Implicit
Monoid
instances for scalajs-react effect types with a monoidal value
- Implicit
-
Add ops for working with generic effects via
import japgolly.scalajs.react.util.syntax._
-
Refactoring around internal effect-agnosticism type class definitions