Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions web/packages/shared/components/Select/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,24 @@ export type Option<T = string, S = string> = {
export type ActionMeta = {
action: 'set-value' | 'input-change' | 'input-blur' | 'menu-close';
};

/**
* CustomSelectComponentProps defines a prop type for the custom
* components you define for react-select's `components` prop.
*
* @template CustomProps - type defining all the custom props being passed
* down to custom component.
*
* @template CustomOption - the data type used for react-select `options`
*/
export type CustomSelectComponentProps<CustomProps, CustomOption = Option> =
CustomOption & {
/**
* selectProps is the field to use to access the props that were
* passed down to react-select's component.
*
* Use `customProps` field to easily identify non react-select props
* that are intended to be used in custom components.
*/
selectProps: { customProps: CustomProps };
};