diff --git a/types/react-router-dom/react-router-dom-tests.tsx b/types/react-router-dom/react-router-dom-tests.tsx new file mode 100644 index 0000000000..c748405580 --- /dev/null +++ b/types/react-router-dom/react-router-dom-tests.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { + NavLink, + NavLinkProps, + match +} from 'react-router-dom'; +import * as H from 'history'; + +const getIsActive = (extraProp: string) => (match: match, location: H.Location) => !!extraProp; + +interface Props extends NavLinkProps { + extraProp: string; +} + +export default function(props: Props) { + const {extraProp, ...rest} = props; + const isActive = getIsActive(extraProp); + return ( + + ); +} diff --git a/types/react-router-dom/tsconfig.json b/types/react-router-dom/tsconfig.json index 41c143c1c6..744d583267 100644 --- a/types/react-router-dom/tsconfig.json +++ b/types/react-router-dom/tsconfig.json @@ -13,6 +13,7 @@ "noEmit": true }, "files": [ - "index.d.ts" + "index.d.ts", + "react-router-dom-tests.tsx" ] }