-
-
Notifications
You must be signed in to change notification settings - Fork 475
Labels
🐛 bugSomething isn't workingSomething isn't workingconfirmedThis bug was confirmedThis bug was confirmed
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Steps to reproduce
- Go to 'this sandbox'
- Run task
dev(which doesyarn dev)
Current behavior
The second button (<Button as={Link} href="www.example.com">Toggle 2</Button>) triggers a typechecker error:
Type '{ children: string; as: ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof InternalLinkProps> & InternalLinkProps & { ...; } & RefAttributes<...>>; href: string; }' is not assignable to type 'Pick<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof InternalLinkProps> & InternalLinkProps & { ...; } & RefAttributes<...>, "slot" | ... 263 more ... | keyof InternalLinkProps>'.
Types of property 'as' are incompatible.
Type 'ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof InternalLinkProps> & InternalLinkProps & { ...; } & RefAttributes<...>>' is not assignable to type 'Url | undefined'.typescript(2322)
Expected behavior
No typechecker error.
Context
#885 made a series of Button and ButtonProps types / interfaces generic, attempting to allow as={...}. For some reason, this is not working for as={Link}.
c0bra
Metadata
Metadata
Assignees
Labels
🐛 bugSomething isn't workingSomething isn't workingconfirmedThis bug was confirmedThis bug was confirmed