diff --git a/types/redux-first-router-link/index.d.ts b/types/redux-first-router-link/index.d.ts index c74bdd530b..1136751129 100644 --- a/types/redux-first-router-link/index.d.ts +++ b/types/redux-first-router-link/index.d.ts @@ -9,8 +9,6 @@ import { Location } from 'redux-first-router'; export type To = string | string[] | object; -export type OnClick = false | ((e: React.MouseEvent) => void); - export interface Match

{ params: P; isExact: boolean; @@ -18,14 +16,12 @@ export interface Match

{ url: string; } -export interface LinkProps { +// Unfortunately we can't pass `HTMLAnchorElement` since the `tagName` attribute allows you to use other tags than anchor. +export interface LinkProps extends React.HTMLAttributes { to: To; redirect?: boolean; replace?: boolean; tagName?: string; - children?: React.ReactNode; - onPress?: OnClick; - onClick?: OnClick; down?: boolean; shouldDispatch?: boolean; target?: string; @@ -33,18 +29,7 @@ export interface LinkProps { export default class Link extends React.Component {} -export interface NavLinkProps { - to: To; - redirect?: boolean; - replace?: boolean; - children?: React.ReactNode; - onPress?: OnClick; - onClick?: OnClick; - down?: boolean; - shouldDispatch?: boolean; - target?: string; - className?: string; - style?: React.CSSProperties; +export interface NavLinkProps extends LinkProps { activeClassName?: string; activeStyle?: React.CSSProperties; ariaCurrent?: string; diff --git a/types/redux-first-router-link/redux-first-router-link-tests.tsx b/types/redux-first-router-link/redux-first-router-link-tests.tsx index 01889e5fe1..86f36c14e3 100644 --- a/types/redux-first-router-link/redux-first-router-link-tests.tsx +++ b/types/redux-first-router-link/redux-first-router-link-tests.tsx @@ -17,6 +17,16 @@ export default () => { { /* as an action object (RECOMMENDED APPROACH SO YOU CAN CHANGE ALL URLs FROM YOUR ROUTESMAP): */ } FP + Home + { isActive={(match, location) => (location.payload as Payload).category === 'redux-first-router'} > Redux First Router + + Nav link with class ); };