We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useMenuButtonContext must be rendered inside of a Dropdown component.
should render component correctly.
FormDropdown.tsx
export interface FormDropdownProps { items: JSX.Element[] } export function FormDropdown({ items, }: FormDropdownProps) { const { isExpanded } = useMenuButtonContext() const [activeItem, setActiveItem] = useState(items[0]) function handleChangeActiveItem(item: JSX.Element) { setActiveItem(item) } return ( <div> <Menu> <MenuButton> {activeItem} <Icon name={IconName.ChevronUp24} className={clsx('h-[9px] w-3.5', isExpanded && 'rotate-180')} /> </MenuButton> <MenuList className="absolute mt-2 flex w-full flex-col gap-1" portal={false} > {items.map((item, index) => ( <MenuItem key={index} onSelect={() => handleChangeActiveItem(item)} > {item} </MenuItem> ))} </MenuList> </Menu> </div> ) }
App.tsx
export function App() { return ( <Dropdown> <FormDropdown items={[]} /> </Dropdown> ) }
The text was updated successfully, but these errors were encountered:
Solution is to use Menu component instead of Dropdown. Please update error to return valid message
Menu
Dropdown
Sorry, something went wrong.
No branches or pull requests
🐛 Bug report
Current Behavior
Expected behavior
should render component correctly.
Reproducible example
FormDropdown.tsx
App.tsx
Suggested solution(s)
Additional context
Your environment
The text was updated successfully, but these errors were encountered: