Releases: molefrog/wouter
Releases · molefrog/wouter
First-class base path support!
Though the base path support was possible before, via a custom useLocation
hook, it wasn't fully SEO-friendly — for example, the link would still have a relative href attribute.
After a long discussion, it's been decided to enable the base path support on a top-level Router component 🎉 You can now just wrap your app with <Router base="/app">
and that's it! Learn more about this feature →
The added bundle cost is just 48 extra bytes.
Preact 10.0, generic types and missing updates
- Wouter now is fully-compatible with Preact 10.0! You can install Preact version via
npm install wouter-preact
#88, thanks @developit - Type definitions now support generics, handy if you want to specify a shape of props your component accepts #87, thanks @ArnaudBarre
useLocation
now also catches updates that may happens between the initial render anduseEffect
call. See #85Redirect
component now usesuseLayoutEffect
to trigger the update as soon as possible and prevent apps from flicker.
Types, types, types... and Preact-only package!
Improvements:
- TypeScript types are now bundled with the library, including types for React and
wouter/preact
! Types are properly tested and can be maintained in the same repo. Thanks to @Ty3uK @StrayFromThePath and @polRk - Wouter now comes with a standalone package with Preact-only version:
npm install wouter-preact
. This makes it possible to use properpeerDependecies
, and stop relying on React in your project #48 #49 cc/ @cedeber - 2nd argument of
useLocation
is now properly cached #74 #69 cc/ @neves - Links do not fire navigation when click using modifier keys like ctrl or ⌘ #68 thanks @marvinhagemeister
setLocation
now supports a 2nd argument which allows to performreplaceState
navigation (@Ty3uK via #52):
setLocation('/about', true); // calls replaceState instead of pushState
v2.1.1
v2.1.0
v1.3.2
Preact is there!
New functionality:
- Added a support for Preact #29 Thanks @StrayFromThePath!