Skip to content

Commit

Permalink
Use SetState from /aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceR committed Nov 27, 2024
1 parent 6a05249 commit b9a264c
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,25 @@ import { USWDSNavDropDownButton } from '../../uswds/header/nav-drop-down-button'
import { USWDSMenu } from '../../uswds/header/menu';
import { DropdownNavLink } from '../types';
import { createDynamicNavMenuList } from './create-dynamic-nav-menu-list';
import { SetState } from '$types/aliases';
import { LinkProperties } from '$types/veda';

interface NavDropDownButtonProps {
item: DropdownNavLink;
isOpen: boolean[];
setIsOpen: React.Dispatch<React.SetStateAction<boolean[]>>;
setIsOpen: SetState<boolean[]>;
index: number;
linkProperties: LinkProperties;
}

export const NavDropDownButton: React.FC<NavDropDownButtonProps> = ({
export const NavDropDownButton = ({
item,
isOpen,
setIsOpen,
index,
linkProperties
}) => {
const onToggle = (
index: number,
setIsOpen: React.Dispatch<React.SetStateAction<boolean[]>>
): void => {
}: NavDropDownButtonProps) => {
const onToggle = (index: number, setIsOpen: SetState<boolean[]>): void => {
setIsOpen((prevIsOpen) => {
const newIsOpen = prevIsOpen.map(
(prev, i) =>
Expand Down

0 comments on commit b9a264c

Please sign in to comment.