mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 02:57:24 +08:00
add disabled property to the Option type
This commit is contained in:
5
react-select/index.d.ts
vendored
5
react-select/index.d.ts
vendored
@@ -29,6 +29,11 @@ declare namespace ReactSelectClass {
|
||||
* @default true
|
||||
*/
|
||||
clearableValue?: boolean;
|
||||
/**
|
||||
* Do not allow this option to be selected
|
||||
* @default false
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface MenuRendererProps {
|
||||
|
||||
@@ -140,7 +140,15 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
|
||||
class SelectWithStringValueTest extends React.Component<React.Props<{}>, {}> {
|
||||
|
||||
render() {
|
||||
const options: Option[] = [{ label: "Foo", value: "bar" }];
|
||||
const options: Option[] = [{
|
||||
label: "Foo",
|
||||
value: "bar",
|
||||
}, {
|
||||
label: "Foo2",
|
||||
value: "bar2",
|
||||
clearableValue: false,
|
||||
disabled: true
|
||||
}];
|
||||
const onChange = (value: any) => console.log(value);
|
||||
|
||||
const selectProps: ReactSelectProps = {
|
||||
|
||||
Reference in New Issue
Block a user