Skip to content

Commit

Permalink
Fix types in custom menu story
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgio committed Jul 6, 2022
1 parent 3908d32 commit c6c62de
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/Typeahead/Typeahead.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Hint from '../Hint';
import Menu from '../Menu';
import MenuItem from '../MenuItem';

import options from '../../tests/data';
import options, { Option } from '../../tests/data';
import { noop } from '../../tests/helpers';

export default {
Expand Down Expand Up @@ -122,16 +122,12 @@ CustomMenu.args = {
renderMenu: (results, menuProps) => (
<Menu {...menuProps}>
{/* Use `slice` to avoid mutating the original array */}
{results
{(results as Option[])
.slice()
.reverse()
.map((r, index) => (
// @ts-ignore
<MenuItem key={r.name} option={r} position={index}>
{
// @ts-ignore
r.name
}
{r.name}
</MenuItem>
))}
</Menu>
Expand Down

0 comments on commit c6c62de

Please sign in to comment.