[@mantine/core] Group: extend props with BoxProps
I was looking to create a (HTML) <header> whit the styling of a Group.
Since the (others) props are spread and the Box component has a component prop that would accept a header value.
Not sure if some omitting should be done (Omit<BoxProps, '...'>) tho.
Group already has all BoxProps – it extends DefaultProps which is basically the same thing in this context.
I may miss something but... I'm getting a TS error when trying to use something like
<Group component="header">
{/* ... */}
</Group>
https://codesandbox.io/s/pedantic-goldstine-bh135s?file=/src/App.tsx
Group is not supposed to be used as polymorphic component – it manages layout, not functionality, you should wrap it with header element instead:
<header><Group /></header>
I guess I'll rather style the header element with some "good'ol CSS" than nesting elements and cluttering the DOM to achieve that.
Thanks anyways.
On Tue, Aug 9, 2022, 09:37 Vitaly Rtishchev @.***> wrote:
Group is not supposed to be used as polymorphic component – it manages layout, not functionality, you should wrap it with header element instead:
— Reply to this email directly, view it on GitHub https://github.com/mantinedev/mantine/pull/2053#issuecomment-1209023279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQDM2W2EMFQMLYJVQ3C7LVYIDCVANCNFSM557OCGNQ . You are receiving this because you authored the thread.Message ID: @.***>