🥢 A minimalist-friendly ~2.1KB routing for React and Preact
npm install wouter-preact
#88, thanks @developituseLocation
now also catches updates that may happens between the initial render and useEffect
call. See #85Redirect
component now uses useLayoutEffect
to trigger the update as soon as possible and prevent apps from flicker.Improvements:
wouter/preact
! Types are properly tested and can be maintained in the same repo. Thanks to @Ty3uK @StrayFromThePath and @polRknpm install wouter-preact
. This makes it possible to use proper peerDependecies
, and stop relying on React in your project #48 #49 cc/ @cedeberuseLocation
is now properly cached #74 #69 cc/ @nevessetLocation
now supports a 2nd argument which allows to perform replaceState
navigation (@Ty3uK via #52):setLocation('/about', true); // calls replaceState instead of pushState
Bugfixes:
Improvements:
useLocation
accepts router
as an argument #44useEffect
, code only runs on mount/unmount #41 @jeetissBugfixes:
react-deps.js
to the list of files to publish #34New functionality:
Bugfixes:
<Link />
component which resulted being unable to customize the link element #26Bugfixes:
back/go
navigationBugfixes:
Redirect
component (#21 by @StrayFromThePath)<Redirect>
and <Switch>
components #7onClick
handler to <Link>
component #12extra/static-history.js
history #6