Skip to content

Commit

Permalink
fix($readme): add ariaCurrent prop docs
Browse files Browse the repository at this point in the history
  • Loading branch information
faceyspacey committed Aug 23, 2017
1 parent ea23046 commit ae88dc4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ const to = `/list/${category}` // can get long & yucky with lots of variables
* **exact: boolean = false** - if `true` supplied, active class/styles will not be applied in this example: URL is `/foo/bar` and link `to` is `/foo`. Whereas by default they would match.
* **strict: boolean = false** - if there is a trailing slash in the `to` path or URL, they both must have the slash to match. If there is no slash, they must both have *no* slash.
* **isActive: (match, location) => boolean** - a custom function to determine whether the link is active. Return `true` if active. The `match` argument is identical to React Router and not very useful. The `location` is `state.location`.
* **ariaCurrent: string** - defaults to `'true'` when active. It's for screen-readers. Learn more [here](https://tink.uk/using-the-aria-current-attribute).

## Final Notes
* In previous versions the `to` prop was named `href` and the `onClick` prop was name `onPress`. Those still work, but they are identical to their new names. They will be removed eventually.
Expand Down

3 comments on commit ae88dc4

@swernerx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool new feature. Question is why it defaults to true. Following the documentation you linked shouldn't it be better 'page'?

@faceyspacey
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react router does it. i barely understand the feature :)

@faceyspacey
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it came because someone else wanted "active" as the default activeClassName, as react router has that. ..then i noticed this as another default.

Please # to comment.