Palak@tru free asked 5 years ago


I want to hide and show sidebar on click of a custom button created using MDBBtn .How to achieve that?


Konrad Stępień staff answered 5 years ago


Hi @Palak@tru,

If you use basic example from here

just set this function

  handleToggle = () => {
    this.setState({
      isOpen: !this.state.isOpen
    });
  };

for your custom button with onClick method.

For example:

<MDBBtn color="elegant" onClick={this.handleToggle}>Toggler</MDBBtn>

Kind regards, Konrad.



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.0
  • Device: MacBookAir
  • Browser: Chrome
  • OS: Mac
  • Provided sample code: No
  • Provided link: No