DefinitelyTyped/types/ink-select-input/ink-select-input-tests.tsx
Kubo Satnik b36aeafe88 Ink select input update for latest version and ink2 support (#34192)
* Update ink-select-input to support latest version and ink2

* Major version up

* Fix travis errors

* Fix travis errors

* Fixed travis errors 3
2019-03-27 16:15:22 -07:00

32 lines
741 B
TypeScript

import * as React from 'react';
// tslint:disable-next-line:import-name
import SelectInput, { ItemOfSelectInput } from 'ink-select-input';
// NOTE: `import SelectInput = require('ink-select-input');` will work as well.
// If importing using ES6 default import as above,
// `allowSyntheticDefaultImports` flag in compiler options needs to be set to `true`
const items: ReadonlyArray<ItemOfSelectInput> = [
{
label: 'First',
value: 'first',
key: 0,
},
{
label: 'Second',
value: 'second',
},
{
label: 'Third',
value: 'third',
},
];
class Demo extends React.PureComponent {
handleSelect = (item: ItemOfSelectInput) => {};
render() {
return <SelectInput items={items} onSelect={this.handleSelect} />;
}
}