From 2be4433c5c69ff0732891b22cd66b05d4e8a8743 Mon Sep 17 00:00:00 2001 From: Felipe Lacerda Date: Thu, 30 May 2019 20:01:28 +0200 Subject: [PATCH] [atlaskit__tree] Accept null innerRef argument (#35814) The current type doesn't match the type Ref for React's ref prop: TS2322: Type '(element?: HTMLElement | undefined) => void' is not assignable to type 'string | ((instance: HTMLDivElement | null) => void) | RefObject | null | undefined'. Type '(element?: HTMLElement | undefined) => void' is not assignable to type '(instance: HTMLDivElement | null) => void'. Types of parameters 'element' and 'instance' are incompatible. Type 'HTMLDivElement | null' is not assignable to type 'HTMLElement | undefined'. Type 'null' is not assignable to type 'HTMLElement | undefined'. This change allows the argument to innerRef to be null, which makes the types match. --- types/atlaskit__tree/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/atlaskit__tree/index.d.ts b/types/atlaskit__tree/index.d.ts index 4d6a952b76..c864ad342d 100644 --- a/types/atlaskit__tree/index.d.ts +++ b/types/atlaskit__tree/index.d.ts @@ -65,7 +65,7 @@ interface TreeDraggableProvided { // will be null if the draggable is disabled dragHandleProps?: DraggableProvidedDragHandleProps; // The following props will be removed once we move to react 16 - innerRef: (element?: HTMLElement) => void; + innerRef: (element?: HTMLElement | null) => void; } export interface RenderItemParams {