React Router V4 Implement NavLink inside a ListItem using Material UI

后端 未结 3 1735
礼貌的吻别
礼貌的吻别 2021-02-06 01:50

I am new to React and I created a simple application with Login and Dashboard page. I have successfully configured my Public Routes

3条回答
  •  清歌不尽
    2021-02-06 02:28

    You can attach a class to NavLink with something like:

    
      Dashboard
    
    

    Then, attach styling to this class as:

    .nav-link-item {
      color: inherit;
      text-decoration: none;
    }
    
    .nav-link-item:hover,
    .nav-link-item:active,
    .nav-link-item:visited {
      color: red;
      text-decoration: none;
    }
    
    /* Styling for when the link is active */
    .nav-link-item.active {
      color: green;
    }
    

提交回复
热议问题