score:0

 const [toggle, setToggle] = useState(false)
 const onClick = () => {
    setToggle(true)  
 }

 <List>
        {items && items.map((subItem, index) => (
          <SidebarItem
            key={`${subItem}${index}`} 
            item={subItem}/>
            className={`${toggle} ? 'className1' : ''`}
            onClick={onCLick}
        ))}
</List>
 

Related Query

More Query from same tag