DefinitelyTyped/types/react-virtualized-select/react-virtualized-select-tests.tsx
2018-03-09 12:16:47 +01:00

30 lines
632 B
TypeScript

import * as React from "react";
import Select from "react-select";
import VirtualizedSelect from "react-virtualized-select";
/*Example TValue.*/
interface Example {
name: string;
}
/*Example generic class.*/
class ExampleSelectAsync 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'}])}
/>
</div>;