React Router v4 setting activeClass on parent

前端 未结 4 1109
猫巷女王i
猫巷女王i 2021-01-17 16:13

Not too familiar with react router, but I need the functionality of the NavLink to set the active class on the parent li element, and not the a ele

4条回答
  •  忘掉有多难
    2021-01-17 16:35

    Check this one

    class LiNavLink extends React.Component {
        render() {
            return (
                
                    {
                        ({ match }) =>
                            
  • {this.props.children}
  • }
    ); } }

提交回复
热议问题