My question is regarding changing the CSS of classes through another class. I'm aware that I can only change the CSS if the element we're trying to change is adjacent or a sibling of the selected element.
My goal is to change the background color of the header and tabs class when the Link 'Bloody Mary' is selected but I don't know how to accomplish this. I am using React and the way I thought about it was using states. The default would be white and when the Bloody Mary link is active, it would change the state from white to black. I also plan on changing other styles like the font color but the main idea remains the same, changing the styling dynamically through react.
I have stripped my code to the basics so it looks cleaner. If you can offer some help it would be appreciated.
class Header extends React.Component {
render () {
return(
<div>
<div className='header'>
<li className='tabs'><NavLink className='style'
activeClassName='selected'>Home</NavLink></li>
<li className='tabs'><NavLink className='style'
activeClassName='selected'>Team</NavLink></li>
<div className='dropdown'>
<div className='tabs'><NavLink className='style projectstab'
activeClassName='selected'>Projects</NavLink></div>
<div className='dropdown-content'>
<a>
<p className='dropdown-li'>
</p>
<NavLink activeClassName='bloodyselected'>
Bloody Mary
</NavLink>
</a>
</div>
</div>
<li className='tabs'><NavLink className='style'
activeClassName='selected'>Contact Us</NavLink></li>
</div>
)
}
}