From ab0e2d66e0779f07eeaac1b25322ac4e5190e97a Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 4 Apr 2019 11:43:46 +0200 Subject: [PATCH 1/2] [react-router-dom] Add failing test for ref objects --- types/react-router-dom/react-router-dom-tests.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/types/react-router-dom/react-router-dom-tests.tsx b/types/react-router-dom/react-router-dom-tests.tsx index a7715e9ea1..9a524e88df 100644 --- a/types/react-router-dom/react-router-dom-tests.tsx +++ b/types/react-router-dom/react-router-dom-tests.tsx @@ -39,5 +39,7 @@ const Component: React.SFC = props => { ; -const acceptRef = (node: HTMLAnchorElement | null) => {}; -; +const refCallback: React.Ref = node => {}; +; +const ref = React.createRef(); +; From 108cd4c5b510fe621d8530c4c87784707120a944 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 4 Apr 2019 11:45:06 +0200 Subject: [PATCH 2/2] [react-router-dom] Fix innerRef not accepting ref objects --- types/react-router-dom/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-router-dom/index.d.ts b/types/react-router-dom/index.d.ts index c16a334a08..22688beb66 100644 --- a/types/react-router-dom/index.d.ts +++ b/types/react-router-dom/index.d.ts @@ -4,6 +4,7 @@ // Huy Nguyen // Philip Jackson // John Reilly +// Sebastian Silbermann // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -47,7 +48,7 @@ export class HashRouter extends React.Component {} export interface LinkProps extends React.AnchorHTMLAttributes { to: H.LocationDescriptor; replace?: boolean; - innerRef?: (node: HTMLAnchorElement | null) => void; + innerRef?: React.Ref; } export class Link extends React.Component {}