mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Fix value type for react-select
This commit is contained in:
@@ -141,6 +141,25 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
|
||||
}
|
||||
}
|
||||
|
||||
class SelectWithStringValueTest extends React.Component<React.Props<{}>, {}> {
|
||||
|
||||
render() {
|
||||
const options: Option[] = [{ label: "Foo", value: "bar" }];
|
||||
const onChange = (value: any) => console.log(value);
|
||||
|
||||
const selectProps: ReactSelectProps = {
|
||||
name: "test-select-with-string-value",
|
||||
value: "bar",
|
||||
options: options,
|
||||
onChange: onChange
|
||||
};
|
||||
|
||||
return <div>
|
||||
<Select {...selectProps} />
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
class SelectAsyncTest extends React.Component<React.Props<{}>, {}> {
|
||||
|
||||
render() {
|
||||
|
||||
2
react-select/react-select.d.ts
vendored
2
react-select/react-select.d.ts
vendored
@@ -303,7 +303,7 @@ declare namespace ReactSelect {
|
||||
/**
|
||||
* initial field value
|
||||
*/
|
||||
value?: Option | Option[];
|
||||
value?: Option | Option[] | string | string[] | number | number[];
|
||||
/**
|
||||
* the option property to use for the value
|
||||
* @default "value"
|
||||
|
||||
Reference in New Issue
Block a user