fredrekt free asked 4 years ago


How can i change active status on an MDBNavItem

tried storing it in state like: this.state = { activeStat: false, }

Medishop {!this.state.isWideEnough && } {/* /} Home About Medicines Contact {/ */} Login Register Logout

              <MDBNavItem>
                <MDBDropdown>
                <MDBDropdownToggle nav caret>
                  {/* <MDBNavLink style={{color:this.state.color}}  className="nav-option" to="/sign-in"><MDBIcon size="lg" icon="shopping-cart" /><MDBBadge color="danger" className="ml-2">0</MDBBadge></MDBNavLink> */}
                  <Link className="white-text" to="/cart">
                    <MDBIcon size="lg" icon="shopping-cart" /><MDBBadge color="danger" className="ml-2">0</MDBBadge>
                  </Link>
                </MDBDropdownToggle>
                <MDBDropdownMenu>
                  <MDBDropdownItem>
                   <Link to="/my-account">
                   Account
                   </Link>
                  </MDBDropdownItem>
                  <MDBDropdownItem>
                    <Link to="/help">
                    Help
                    </Link>
                  </MDBDropdownItem>
                  <MDBDropdownItem>
                    <Link to="/">
                    Logout
                    </Link>
                  </MDBDropdownItem>
                </MDBDropdownMenu>
                </MDBDropdown>
              </MDBNavItem> 

            </MDBNavbarNav>
          </MDBCollapse>
        </MDBNavbar>

Jakub Chmura staff answered 4 years ago


Hi,

Can I ask you to show me all your code with states and functions? That sample is not enough for me to help you with this problem.

If you want to menage state you must write a function that will change the state to active or inactive.

Best Regards, Kuba



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.19.2
  • Device: Iphone X
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No