daisyui / react-daisyui

daisyUI components built with React 🌼
http://react.daisyui.com/
MIT License
886 stars 98 forks source link

Docs don't reflect current version? #443

Closed pedrolucasp closed 3 months ago

pedrolucasp commented 4 months ago

For example, Tabs states the following:

    <Tabs {...args}>
      <RadioTab name="my_tabs_1" label="Tab 1" contentClassName="p-10">
        Tab content 1
      </RadioTab>
      <RadioTab name="my_tabs_1" label="Tab 2" contentClassName="p-10" defaultChecked={true}>
        Tab content 2
      </RadioTab>
      <RadioTab name="my_tabs_1" label="Tab 3" contentClassName="p-10">
        Tab content 3
      </RadioTab>
    </Tabs>

I noticed something off when trying to use the Tabs component. First, it does not mention where exactly this import statement is coming from, so you would assume we need to do an import { Tabs, RadioTab } from 'react-daisyui'. This continuously renders an empty component for the RadioTab, which if you verify it by console.log it. In addition to that, if you console.log the Tabs.RadioTab component, you'll realize that this is a working component.

But it doesn't work the way it's intended to, since it renders default Radio buttons (at least for me), which can be something I'm missing... but then again, the documentation is pretty lacking so I have no clue, and no clear examples since the ones provided don't match.

I've realized this pattern with the Table component as well, so I think either there are multiple ways to do the same thing or some version mismatch between the documentation and the exports.

benjitrosch commented 4 months ago

@pedrolucasp Thanks for finding that, I'll fix up the docs this week. Some of the internally used components are exposed as subcomponents, which sometimes don't get captured in the docs by whichever contributor writes the story.

benjitrosch commented 3 months ago

Fixed with ad4cb0e27a1270ae606ef5cc91d16fe41454db07 and the new pages should deploy soon.