import React, { useRef } from "react"; import { useListBox, useOption } from "@react-aria/listbox"; import styles from "./ListBox.module.css"; import classNames from "classnames"; export function ListBox(props) { const ref = useRef(); let { listBoxRef = ref, state } = props; const { listBoxProps } = useListBox(props, state, listBoxRef); return ( ); } function Option({ item, state, className }) { const ref = useRef(); const { optionProps, isSelected, isFocused, isDisabled } = useOption( { key: item.key }, state, ref ); return (
  • {item.rendered}
  • ); }