Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 18 additions & 0 deletions docs/pages/typescript/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,24 @@ const onChange = (option: readonly Option[], actionMeta: ActionMeta<Option>) =>
~~~

The \`actionMeta\` parameter is optional. \`ActionMeta\` is a union that is discriminated on the \`action\` type. Take a look at at [types.ts](https://github.com/JedWatson/react-select/blob/master/packages/react-select/src/types.ts) in the source code to see its full definition.

## Custom Select props

You can use module augmentation to add custom props to the \`Select\` prop types:

~~~jsx
declare module 'react-select/dist/declarations/src/Select' {
export interface Props<
Option,
IsMulti extends boolean,
Group extends GroupBase<Option>
> {
myCustomProp: string;
}
}
~~~

This will make the custom prop available both when using the \`Select\` component as well as when accessing \`selectProps\` when [customizing components](./components).
`}
</>
);
Expand Down
14 changes: 14 additions & 0 deletions docs/pages/upgrade/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ import { ... } from 'react-select/dist/declarations/src/...';

We export any types from the main entry point that we think might be useful to the user. If you are using a type that is not exported from the main entry point please open a PR or issue so that we can add it.

If you are using custom props for the \`Select\` component you can use module augmentation to add them to the \`Select\` prop types:

~~~jsx
declare module 'react-select/dist/declarations/src/Select' {
export interface Props<
Option,
IsMulti extends boolean,
Group extends GroupBase<Option>
> {
myCustomProp: string;
}
}
~~~

#### Drop IE11 support

This allows us to use modern CSS in order to improve the quality of \`react-select\` and remove excessive JavaScript code to work around not having the ability to use modern CSS. If you need IE11 support either:
Expand Down