A custom React router that leverages the Web Animations API and CSS animations.
This update is a big refactor with stability around animation ending, took out some hacky things, some optimization but not a lot, and extra debugging and testing.
We now enforce animation-fill-mode: forwards
on animations, and the Animation.onfinish
callback to prevent flashing and bad timeouts. Unfortunately, the best way to perform CSS class animations is still setTimeout
, but repeat renders (setting state when unnecessary) is prevented.
Breaking changes:
Renamed the <Smoothr>
configAnimationSetDuration
to beforeAnimation
.
Renamed the <Route>
pathMask
property to pathResolve
.
Also, some debugging of the demo.
Also, I put in a delay that hopefully adds stability and removes flashing on navigation.
Fixed buggy behavior when animation is interrupted. Now the app just snaps to the next app if animation transition is interrupted. Also minor cleanup in demo.
data-smoothr-current-link
and data-smoothr-visited-link
attribute instead of disabled on Links.fuzzyDisable
to fuzzyCurrent
, leave the disabled
attribute aloneThis release adds the pathMask
prop to <Route>
s, which adds the ability to validate parameters the url and redirect, either to the notFound
<Route>
, or to a composed validated path.
I also realized that there was a bug with a hash algorithm used in this library on IE11, so that was fixed.