From 281cb13202b0270233492d17e370b7306a13bf37 Mon Sep 17 00:00:00 2001 From: Pedro Nauck Date: Fri, 29 Mar 2019 15:02:23 -0300 Subject: [PATCH] fix(docz): incompatible props on Link --- core/docz/src/components/Link.tsx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/core/docz/src/components/Link.tsx b/core/docz/src/components/Link.tsx index 7bddf0d68..955fef708 100644 --- a/core/docz/src/components/Link.tsx +++ b/core/docz/src/components/Link.tsx @@ -1,17 +1,21 @@ import * as React from 'react' import { useCallback } from 'react' import { Link as BaseLink, LinkProps, LinkGetProps } from '@reach/router' +import { omit } from 'lodash/fp' export { LinkProps } -export const Link = React.forwardRef>((props, ref) => { - const isActive = useCallback( - ({ isCurrent }: LinkGetProps) => { - return isCurrent ? { className: `${props.className} active` } : {} - }, - [props.className] - ) +export const Link = React.forwardRef>( + (defaultProps, ref) => { + const props = omit(['activeClassName', 'partiallyActive'], defaultProps) + const isActive = useCallback( + ({ isCurrent }: LinkGetProps) => { + return isCurrent ? { className: `${props.className} active` } : {} + }, + [props.className] + ) - return -}) + return + } +) Link.displayName = 'Link'