themesberg / themesberg/flowbite-react

Issue with Rendering Tab Titles Using flowbite-react Library

Open
#1,057 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:bug: bug help wanted needs info
Dominant language
TypeScript
Stars
2.1k
Forks
506
PR merge metrics
No merged PRs in 30d

Description

I am currently working on a project using the flowbite-react library to create tabs within a Reactjs application. While attempting to display tab titles dynamically using a map loop, I have encountered an issue where the titles are not showing.

Problem Description:

I have a Reactjs component where I conditionally render tabs based on the contentType. When contentType is set to "resources," I map over a content array and attempt to display tab titles and descriptions for each element in the array. However, I am experiencing difficulties with the titles not showing up.

Code Snippet:

{
  this.props.contentType === "resources" && (
    <Tabs.Group aria-label="Pills" style="pills">
      {this.props.content.map((el, i) => {
        return (
          <>
            <Tabs.Item className="Chinmoy" key={i} title={el.label}>
              <p className="">{el.description}</p>
            </Tabs.Item>
          </>
        );
      })}
    </Tabs.Group>
  );
}

Expectation:

I expect the titles to be displayed for each tab, with the el.label values from the content array being used as tab titles, while it works properly on the library documentation on a static jsx code, see here.

Actual Result:

However, the titles are not showing up as expected, and I cannot identify the root cause of this issue.

What I've Tried:

  • I have confirmed that the el.label values in the content array are not empty or undefined.
  • I've checked the library's documentation, but I couldn't find any specific guidance regarding this issue.

Screenshot:

enter image description here

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided React component that maps content into flowbite-react Tabs.Group and compare it with the linked static tabs example. Reproduce the missing titles using the supplied content shape, then verify that each mapped tab renders its el.label value and document the cause and result.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.