<div
className={className}
{...rest}
role="button"
tabIndex={0}
onClick={toggleExpanded}
onKeyDown={handleKeyPress}
data-accordion-component="AccordionItemButton"
/>
<button
className={className}
{...rest}
tabIndex={0}
onClick={toggleExpanded}
onKeyDown={handleKeyPress}
data-accordion-component="AccordionItemButton"
/>
Hey there - if you alter the following code to use
buttoninstead ofdivyou can remove the need for anroleattribute as thebuttonelement is being used.Before
After
Other notes
There might be some styling and other changes but it would be a improvement ✌🏼