Skip to content

Commit

Permalink
Expand isActive API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
taion committed Mar 7, 2016
1 parent 0768baa commit 69ade99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ Creates a URL, using the router's config. For example, it will add `#/` in front
##### `isActive(pathOrLoc, indexOnly)`
Returns `true` or `false` depending on if the `pathOrLoc` is active. Will be true for every route in the route branch matched (child route is active, therefore parent is too), unless `indexOnly` is specified, in which case it will only match the exact path.

A route is only considered active if all the URL parameters match, including optional parameters and their presence or absence.

However, only explicitly specified query parameters will be checked. That means that `isActive({ pathname: '/foo', query: { a: 'b' } })` will return `true` when the location is `/foo?a=b&c=d`. To require that a query parameter be absent, specify its value as an explicit `undefined`, e.g. `isActive({ pathname: '/foo', query: { a: 'b', c: undefined } })`, which would be `false` in this example.


## Configuration Components

Expand Down

0 comments on commit 69ade99

Please sign in to comment.