How to add classes in the menu selection?

How to make more correct adding classes if you select the menu item ?
className={ typeDisplay === "map" ? "type-display-list__item type-display-list__item_active type-display-item" : "type-display-list__item type-display-item"}
March 19th 20 at 08:40
2 answers
March 19th 20 at 08:42
To work with classes I recommend to use classnames
March 19th 20 at 08:44
so a bit shorter

className={ `type-display-list__item type-display item ${ typeDisplay === "map" ? 'type-display-list__item_active' : "}`}

Find more questions by tags React