-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect element name in StoryBook #289
Comments
Hi @Kye-NG, you can accomplish this with destructuring at the top of your file. e.g.: import { Tabs } from 'react-daisyui'
const { Tab } = Tabs
export default (props) => {
return (
<Tabs>
<Tab value="one">Tab 1</Tab>
<Tab value="two">Tab 2</Tab>
</Tabs>
)
} |
Thanks @benjitrosch Would it be a good idea to note this in StoryBook? |
Good question @Kye-NG— it might seem obvious to just include it, but I'm a little conflicted. Would love to hear your thoughts! The Problem: If we move it into the component's code, that would promote bad practices, and I'm concerned people would take that to be the "correct" way to access subcomponents. Alternatively, we could rewrite all of the Storybook examples to remove destructuring of subcomponents, aka replace |
As someone that just started to get familiar with the code base, my opinion is that would be better if it was consistent, so your solution @benjitrosch of rewriting the Storybook examples would be the best. For example, Stats, Steps and Table are shown in the examples as being accessed without being deconstructed. Select on the other hand is being deconstructed the same way as Tab is. |
Tab Element Name Incorrect.
Currently all the
Tabs
in storybook showTab
as the element name.https://react.daisyui.com/?path=/story/navigation-tabs--lifted
But
Tab
is not exported byreact-daisyui
.The correct element name is
Tabs.Tab
like below:Fix
Update storybook to show
Tabs.Tab
for Tab elements.This is probably a good "first-fix" kind of ticket.
The text was updated successfully, but these errors were encountered: