Skip to content
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

Documentation/implementation of the Tabs component is ambiguous #198

Open
maartenraes opened this issue Jan 28, 2021 · 0 comments
Open

Documentation/implementation of the Tabs component is ambiguous #198

maartenraes opened this issue Jan 28, 2021 · 0 comments

Comments

@maartenraes
Copy link
Contributor

maartenraes commented Jan 28, 2021

Describe the bug

When implementing the Tabs component I found the documentation not very clear.
The items expect a target value which is later renamed to href when using it in the linkProps
Target shouldn't be used as href since target itself can also be used in a link element to define target="_self" or target="_blank"

It's also not clear that the linkProps function only receives an href prop.
I had to dig into the source code to see why it suddenly was called href instead of target

To Reproduce

Look at the docs on here

Expected behavior

Rename items.target to items.href

type TabItems = {
  name: string,
  href: string,
  active?: boolean,
  disabled?: boolean
 }[];

Add better docs to the linkProps function

linkProps = ({ href: string }) => { component: React.Node, [key: string]: any }

Where [key: string]: any is the definition of all the custom props you want to add, in case of a react-router-dom link element this would be at least the prop to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant