I'm trying to add a className to the ul element if contains a child with an specific className. Using only css it's not possible (it's :has but only in css 4). I'm trying to made this with react but I can't figure it out.
const MenuLink = () => (
<ul className="parent">
<li>
<NavLink activeClassName="is-active" className="link">
link 1
</NavLink>
</li>
<li>
<NavLink activeClassName="is-active" className="link">
link 2
</NavLink>
</li>
<li>
<NavLink activeClassName="is-active" className="link">
link 3
</NavLink>
</li>
</ul>
);
I want to add a class to the ul if .is-active is present in a children.