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

Impossible to wrap Header, Content and Footer #13

Open
Foprta opened this issue Jul 31, 2024 · 1 comment
Open

Impossible to wrap Header, Content and Footer #13

Foprta opened this issue Jul 31, 2024 · 1 comment

Comments

@Foprta
Copy link

Foprta commented Jul 31, 2024

It's impossible to wraph Header, Content and Footer with custom components.

Because of te getItem realization its impossible to render something like that:

const CustomHeader = (props) => {
  return <Header className="my-custom-class" {...props}/>
}

<Portal>
  <Sheet>
    <CustomHeader />
  </Sheet>
</Portal>

May be we could rely on displayName or smth like that instead of type in getItem?

const getItem = (
   ...
   child.type === Component
   ...
}
@Foprta Foprta changed the title Impossible to wrap Heacder, Content and Footer Impossible to wrap Header, Content and Footer Jul 31, 2024
@woofers
Copy link
Owner

woofers commented Aug 23, 2024

@Foprta Thanks for the report, I would be a bit hesitant to rely on displayName as it may cause the wrong components to be inadvertently picked up depending on the name.

Instead I would be open to adding some kind of CustomerHeader.sheetElement = "Header" API but at the moment I don't have any immediately plans to implement this.

As a workaround I would maybe opt for some kind of API like: <Header {...getCustomerHeaderProps({ className: '' })} />

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

No branches or pull requests

2 participants