Right now this code shows a dropdown form that lists "option #". How can I make all of the fifty states selectable instead of the option and a number?
import React, { useState } from 'react';
import {
Box,
FormField,
Grommet,
Select,
MaskedInput,
TextInput
} from 'grommet';
import { grommet } from 'grommet/themes';
const allOptions = Array(50)
.fill()
.map((_, i) => `option ${i + 1}`);
export const Simple = () => {
const [value, setValue] = useState('');
return (
<Grommet theme={grommet}>
<Box align="center" background="light-2" >
<FormField label="State" htmlFor="select" >
<Select
id="select"
placeholder="placeholder"
options={allOptions}
value={value}
onChange={({ option }) => setValue(option)}
/>
</FormField>
</Box>
</Grommet>
);
};
export default {
title: 'Input/FormField/Simple',
};