@@ -28,36 +28,33 @@ const Template: Story = (args) => (
);
-export const Default = Template.bind({});
+export const Default = Template().bind({});
Default.args = {
...defaultProps,
};
-export const CustomOption = Template.bind({});
+export const CustomOption = Template().bind({});
CustomOption.args = {
...defaultProps,
options: [{ customOption: true, name: 'custom option' }],
text: 'custom option',
};
-export const Pagination = Template.bind({});
+export const Pagination = Template().bind({});
Pagination.args = {
...defaultProps,
options: [...options.slice(0, 5), { paginationOption: true }],
};
-export const CustomChildren = Template.bind({});
+export const CustomChildren = Template
().bind({});
CustomChildren.args = {
...defaultProps,
renderMenuItemChildren: (option) => {
- const name = getOptionProperty(option, 'name');
- const population = getOptionProperty(option, 'population');
-
return (
<>
- {name}
+ {option.name}
- Population: {population.toString()}
+ Population: {option.population.toString()}
>
);
diff --git a/src/components/TypeaheadMenu/TypeaheadMenu.tsx b/src/components/TypeaheadMenu/TypeaheadMenu.tsx
index ef04c60f..292f7c35 100644
--- a/src/components/TypeaheadMenu/TypeaheadMenu.tsx
+++ b/src/components/TypeaheadMenu/TypeaheadMenu.tsx
@@ -6,20 +6,20 @@ import Menu, { MenuProps } from '../Menu';
import MenuItem from '../MenuItem';
import { getOptionLabel, getOptionProperty, isString } from '../../utils';
-import { LabelKey, Option } from '../../types';
+import { LabelKey, OptionType } from '../../types';
-export type RenderMenuItemChildren = (
+export type RenderMenuItemChildren