Skip to content

Documentation/implementation of the Tabs component is ambiguous #198

Open
@maartenraes

Description

@maartenraes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions