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

Interface extends are supported but not the type ampersand syntax #928

Open
rvetere opened this issue May 30, 2024 · 0 comments
Open

Interface extends are supported but not the type ampersand syntax #928

rvetere opened this issue May 30, 2024 · 0 comments

Comments

@rvetere
Copy link
Contributor

rvetere commented May 30, 2024

If we use types in Typescript that can be extended with ampersand syntax &, it won't work.

For example, we have a pretty funky type definition like this in our repository:

export type ILinkProps = ITypeAgnosticLinkProps &
  Omit<INextLinkProps, "children"> & {
    /**
     * Disables a link, visually and functionally
     * @default false
     */
    isDisabled?: boolean;
    /**
     * Sets `target="_blank"` and `rel="noreferrer"` explicitly.
     * If props contain `target="_blank"` and `rel="noreferrer"`
     * this will be set to isExternal automatically.
     * _NOTE:_ This is a pure technical flag, if you're looking for a visual
     * representation of an external link, use the `icon` and the `iconPosition` prop.
     */
    isExternal?: boolean;
  };

First it won't work because of the Omit, but if that would be solved (or deleted), it still doesn't work as the & is not recognized as extends.

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