mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
37 lines
917 B
TypeScript
37 lines
917 B
TypeScript
import * as React from "react";
|
|
import Select, * as ReactSelect from "react-select";
|
|
import VirtualizedSelect from "react-virtualized-select";
|
|
|
|
/*Example TValue.*/
|
|
interface Example {
|
|
name: string;
|
|
}
|
|
|
|
/*Example generic class.*/
|
|
class ExampleSelectAsync extends VirtualizedSelect<Example> {
|
|
}
|
|
|
|
class ExampleSelectCreatable extends VirtualizedSelect<Example> {
|
|
}
|
|
|
|
<div>
|
|
<VirtualizedSelect
|
|
maxHeight={0}
|
|
optionHeight={0}
|
|
optionRenderer={() => <div/>}
|
|
selectComponent={Select}
|
|
options={[]}
|
|
/>
|
|
<ExampleSelectAsync async={true}
|
|
maxHeight={0}
|
|
optionHeight={0}
|
|
optionRenderer={() => <div/>}
|
|
selectComponent={Select}
|
|
loadOptions={(input: string) => Promise.resolve([{name: 'Hi'}])}
|
|
/>
|
|
<ExampleSelectCreatable
|
|
selectComponent={ReactSelect.Creatable}
|
|
isValidNewOption={(arg: {label: string}) => arg.label.length > 1}
|
|
/>
|
|
</div>;
|