react-tagsinput: expose renderLayout (#36304)

* react-tagsinput: expose renderLayout

Exposing `renderLayout` type to be imported by consuming projects.

* Update index.d.ts
This commit is contained in:
Richard Tan
2019-06-24 12:48:09 -07:00
committed by Daniel Rosenwasser
parent 5029800621
commit 350abf6a9a
+4 -1
View File
@@ -1,6 +1,7 @@
// Type definitions for react-tagsinput 3.19
// Project: https://github.com/olahol/react-tagsinput
// Definitions by: Michael Macnair <https://github.com/mykter>
// Richard Tan <https://github.com/chardos>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -42,6 +43,8 @@ declare namespace TagsInput {
readonly tag: Tag;
}
type RenderLayout = (tagComponent: React.Component[], inputComponent: React.Component) => React.ReactChild;
interface ReactTagsInputProps extends React.Props<TagsInput> {
value: Tag[];
onChange: (tags: Tag[], changed: Tag[], changedIndexes: number[]) => void;
@@ -65,7 +68,7 @@ declare namespace TagsInput {
tagDisplayProp?: string | null;
renderTag?: (props: RenderTagProps) => React.ReactNode;
renderInput?: (props: RenderInputProps) => React.ReactNode;
renderLayout?: (tagComponents: React.Component[], inputComponent: React.Component) => React.ReactChild;
renderLayout?: RenderLayout;
preventSubmit?: boolean;
}
}