Skip to content

Revamped Addons

Pre-release
Pre-release
Compare
Choose a tag to compare
@pshrmn pshrmn released this 08 May 18:37
· 1406 commits to master since this release

The 0.7.0 release of the curi package has changed what route object is passed to addons. Previously, addons were passed the route object created by the user. Now, addons are passed the route object created internally by calling createRoute. This allows addons to access any properties that are created for the internal route objects, such as the keys array.

There is also a new addon package: curi-addon-active. This compares a route to the current response object and returns true when the comparison matches. The comparison is done by matching the route's name against the response's name (or sometimes the names in response.partials). If the names match, then the param are compared.

To go along with curi-addon-active, the <Link> component now supports an active prop. This allows you to style the <a> rendered by the link when the <Link> is "active".