Releases: preactjs/preact-router
Releases · preactjs/preact-router
2.0.0-beta1
Installation:
npm install --save preact-router@beta
Possibly Breaking Changes:
- #33: HTML links (
<a href="/..">
) withhref
attributes beginning with/
are now automatically wired up to routers.- You can still use
<Link>
, but it is no longer needed. - Links that match routes for any
Router
will be handled bypreact-router
, otherwise the normal behavior for an HTML link is preserved.
- You can still use
New Features:
- #34:
route(url)
now returnstrue
ifurl
resolved to any routes,false
if nothing matched (for all routers)- Default routes always match, so
route()
will return true if you're using them.
- Default routes always match, so
Other:
- Build migrated to Babel 6
1.4.0
1.3.0
- Add support for Express-style splat params (
/:a*
and/:a+
).- To see the how they work, check out the tests
1.2.4
1.2.0
- Adds support for default routes, which are rendered when no other routes match:
- Adds reasonably good test coverage
Example: Dedicated 404 route
<Router>
<Home path="/" />
<Profile path="/profile/:user" />
<Error404 default />
</Router>
Example: Fall back to homepage for 404's:
<Router>
<Home path="/" default />
<Profile path="/profile/:user" />
</Router>