Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

274
Views
React Bootstrap Tabs- Trying to Control Tab But Failing

I'm trying to use hooks to control a react-bootstrap tab. However I'm not sure how to double it up with Nav and Tab.Content. The official documentation provides instructions on how to do it for normal Tabs but not for what I am trying to do.

As an example, whenever I load up my SPA, the default tabs show nothing. I have to click on Tab 1 or Tab 2 before anything loads.

enter image description here

Here is my card:

              <Card style={{ borderRadius: "0px" }}>
                <TabContainer>
                  <Card.Header>
                    <Nav variant="pills">
                      <Nav.Item>
                        <Nav.Link eventKey="first">
                          <div>Tab 1</div>
                        </Nav.Link>
                      </Nav.Item>
                      <Nav.Item>
                        <Nav.Link eventKey="second">Tab 2</Nav.Link>
                      </Nav.Item>
                    </Nav>
                  </Card.Header>
                  <Card.Body>
                      <Tab.Content>
                        <Tab.Pane eventKey="first">FIRST</Tab.Pane>
                        <Tab.Pane eventKey="second">SECOND</Tab.Pane>
                      </Tab.Content>
                  </Card.Body>
                </TabContainer>
              </Card>

How do I use const [value,setValue] = useState('Tab 1') to work with this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!