Reactstrap: how to set uncontrolled collapse as open by default

Issue

Is there any option to display uncontrolled collapse as opened?

Here is the default code for uncontrolled collapse, it is shown as collapsed tab.

<Button color="primary" id="toggler">
  Toggle
</Button>
<UncontrolledCollapse toggler="#toggler">
  <Card>
    <CardBody>
      Lorem ipsum dolor sit amet consectetur adipisicing...
    </CardBody>
  </Card>
</UncontrolledCollapse>

Solution

Yes, just add:

<UncontrolledCollapse toggler="#toggler" defaultOpen={true}>
...
</UncontrolledCollapse>

Answered By – Veljko Blagojevic

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.