Skip to content

Commit

Permalink
Fix the getProps example (#306)
Browse files Browse the repository at this point in the history
According to https://github.com/reach/router/blob/master/src/index.js#L414 the `getProps` function cannot return `null`.
  • Loading branch information
NoriSte authored and blainekasten committed Dec 3, 2019
1 parent ccfc3c8 commit 0d38c82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/src/markdown/api/Link.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Argument `obj` Properties:
// this is only active when the location pathname is exactly
// the same as the href.
const isActive = ({ isCurrent }) => {
return isCurrent ? { className: "active" } : null
return isCurrent ? { className: "active" } : {}
}

const ExactNavLink = props => (
Expand All @@ -74,7 +74,7 @@ const isPartiallyActive = ({
}) => {
return isPartiallyCurrent
? { className: "active" }
: null
: {}
}

const PartialNavLink = props => (
Expand Down

0 comments on commit 0d38c82

Please sign in to comment.