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

Export of component props types #1524

Open
2 tasks done
miloscript opened this issue Oct 17, 2024 · 0 comments
Open
2 tasks done

Export of component props types #1524

miloscript opened this issue Oct 17, 2024 · 0 comments
Labels
triage We discuss this topic in our internal weekly type: enhancement New feature or request

Comments

@miloscript
Copy link

Prerequisites

  • I have read the Contributing Guidelines.
  • I have not leaked any internal/restricted information like screenshots, videos, code snippets, links etc.

Suggestion / feature request

Hi everybody.

I'm currently trying to write a wrapper around one of the IX components like this:

import { IxModalHeader } from '@siemens/ix-react';

interface ModalHeaderProps
    extends React.HTMLAttributes<HTMLIxModalHeaderElement> {
    children: React.ReactNode;
}

export const ModalHeader = ({ children }: ModalHeaderProps) => {
    return (
        <IxModalHeader>
            <h2>{children}</h2>
        </IxModalHeader>
    );
};

The issue with this approach is that when I use my wrapped component, I'm not being able to pass props from the IXModaHeader like hideClose or icon.

Although I can write these out manually, I was wondering can it be done by importing the props directly, something like this:

interface ModalHeaderProps
    extends IXModalHeaderProps {
    children: React.ReactNode;
}

Is this a functionality you guys find useful? Maybe I am missing something and this is actually possible?

@miloscript miloscript added triage We discuss this topic in our internal weekly type: enhancement New feature or request labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage We discuss this topic in our internal weekly type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant