Я новичок в мире ReactJS и хотел бы знать, как передать активное имя класса элементу <li>
вместо элемента <a>(Link)
.
Теперь у меня такой код. Класс привязки изменяется при нажатии.
<li><IndexLink to='/' activeclassName='active'>A</IndexLink></li>
<li><Link to='/b' activeclassName='active'>B</Link></li>
<li><Link to='/c' activeclassName='active'>C</Link></li>
Но я хотел бы получить что-то похожее на:
<li activeclassName='active'><IndexLink to='/'>A</IndexLink></li>
<li activeclassName='active'><Link to='/b'>B</Link></li>
<li activeclassName='active'><Link to='/c'>C</Link></li>
Заранее спасибо