Palak@tru free asked 3 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 3 years ago

Hi @Palak@tru,

If you use basic example from here

just set this function

  handleToggle = () => {
      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.


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



Specification of the issue

  • User: 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