From 5c4caeb8c8a9b0b6117f3d70842eb47c5fd05ea1 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Mon, 21 Jan 2019 16:45:49 -0500 Subject: [PATCH] Added support for inputRef prop, which accepts a ref to be forwarded to the input --- types/react-mentions/index.d.ts | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/types/react-mentions/index.d.ts b/types/react-mentions/index.d.ts index ff10bbc013..f5892189b1 100644 --- a/types/react-mentions/index.d.ts +++ b/types/react-mentions/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for react-mentions 2.3 +// Type definitions for react-mentions 2.4 // Project: https://github.com/signavio/react-mentions // Definitions by: Scott Willeke +// Eugene Fedorenko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; @@ -41,21 +42,7 @@ export interface MentionsInputProps { style?: any; regex?: RegExp; suggestionsPortalHost?: Element; -} - -/** - * Exposes the type for use with the @see MentionsInputComponent.wrappedInstance which is added by react-mentions' use of substyle (https://github.com/jfschwarz/substyle). - */ -export interface MentionsInputComponentUnrwapped extends React.Component { - inputRef?: HTMLInputElement | HTMLTextAreaElement; -} - -/** - * Used with @see React.RefObject. - */ -export interface MentionsInputComponent extends React.Component { - // MentionsInput uses substyle (https://github.com/jfschwarz/substyle) which adds this wrappedInstance - wrappedInstance?: MentionsInputComponentUnrwapped; + inputRef?: React.RefObject | React.RefObject; } /**