DefinitelyTyped/types/react-bootstrap-typeahead/react-bootstrap-typeahead-tests.tsx
Stéphane S aa0f58044c Typings for react-bootstrap-typeahead (Fix: https://github.com/ericgio/react-bootstrap-typeahead/pull/128) (#22296)
* Start creation of typings for react-bootstrap-typeahead

* Add tslint

* Add tsconfig.json

* Add test file

* Fix trailing comma

* Fix wrong filename

* Set min TypeScript Version to 2.3

* commonjs only??

* If strictFunctionTypes not present it doesn't fallback on a default value

* No consecutive blank lines

* Fix lint errors

* Fix last lint errors

* Remove default export

* Last update
2017-12-19 12:00:44 -08:00

33 lines
1.0 KiB
TypeScript

import * as React from 'react';
import { Typeahead } from 'react-bootstrap-typeahead';
const options = [
{ name: 'Alabama', population: 4780127, capital: 'Montgomery', region: 'South' },
{ name: 'Alaska', population: 710249, capital: 'Juneau', region: 'West' },
{ name: 'Arizona', population: 6392307, capital: 'Phoenix', region: 'West' },
{ name: 'Arkansas', population: 2915958, capital: 'Little Rock', region: 'South' },
{ name: 'California', population: 37254503, capital: 'Sacramento', region: 'West' },
{ name: 'Colorado', population: 5029324, capital: 'Denver', region: 'West' },
];
class BasicExample extends React.Component {
state = {
multiple: false,
};
render() {
const { multiple } = this.state;
return (
<div>
<Typeahead
labelKey="name"
multiple={multiple}
options={options}
placeholder="Choose a state..."
/>
</div>
);
}
}