diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index 35e5bf127d..5906c96d6b 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -7,6 +7,7 @@ // Mark Vujevits // Mike Deverell // MartynasZilinskas +// Onat Yigit Mercan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -49,6 +50,7 @@ declare namespace ReactSelectClass { type OnChangeSingleHandler = OnChangeHandler>; type OnChangeMultipleHandler = OnChangeHandler>; type OnChangeHandler = (newValue: TOption | null) => void; + type OnNewOptionClickHandler = (option: Option) => void; type LoadOptionsHandler = LoadOptionsAsyncHandler | LoadOptionsLegacyHandler; type LoadOptionsAsyncHandler = (input: string) => Promise; @@ -453,6 +455,11 @@ declare namespace ReactSelectClass { * Decides if a keyDown event (eg its 'keyCode') should result in the creation of a new option. */ shouldKeyDownEventCreateNewOption?: ShouldKeyDownEventCreateNewOptionHandler; + + /** + * new option click handler: function (option) {} + */ + onNewOptionClick?: OnNewOptionClickHandler; } interface ReactAsyncSelectProps extends ReactSelectProps {