updated tsconfig, fixed broken tests

This commit is contained in:
Sam Baeck 2018-08-13 22:49:28 +02:00
parent e04532a2b1
commit d29b89c1a8
3 changed files with 8 additions and 6 deletions

View File

@ -2,6 +2,7 @@
// Project: https://github.com/rafrex/react-router-hash-link (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
// Definitions by: Sam Baeck <https://github.com/zoompie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from 'react';
import { LinkProps, NavLinkProps } from 'react-router-dom';

View File

@ -9,15 +9,16 @@ interface Props extends NavHashLinkProps {
const getIsActive = (extraProp: string) => (match: match<any>, location: H.Location) => !!extraProp;
export default function (props: Props) {
export default function(props: Props) {
const {extraProp, ...rest} = props;
const isActive = getIsActive(extraProp);
return (
<NavHashLink {...rest} isActive={isActive} />
);
);
}
<HashLink to="url" />
<HashLink to="url" />;
const acceptRef = (node: HTMLAnchorElement | null) => {};
<HashLink to="/url" replace={true} innerRef={acceptRef} />;
const acceptRef = (node: HTMLAnchorElement | null) => {
};
<HashLink to="/url" replace={true} innerRef={acceptRef} />;

View File

@ -19,6 +19,6 @@
},
"files": [
"index.d.ts",
"react-router-hash-link-tests.ts"
"react-router-hash-link-tests.tsx"
]
}