`styled(MantineButton)` rejects all props in 6.4.2 (regression from 6.1.x)
Author: dennisoelkersCreated May 27, 2026Updated Aug 11, 2026
In 6.1.x, wrapping a component whose React.ComponentPropsWithRef<typeof T> resolves to {} produced a styled component that was permissive enough to accept arbitrary props at JSX call sites. In 6.4.2 the same code rejects every prop, including children.
This breaks every styled(X) where X is a Mantine v7 polymorphic-factory component (Button, Card, Menu.Item, Badge, SegmentedControl, …). TypeScript can't introspect Mantine's callable-generic intersection, so React.ComponentPropsWithRef<typeof X> resolves to {} in any sc version. 6.1.x stayed permissive on that empty BaseProps; 6.4.2 does not.
Simple Example
import * as React from 'react';
import styled from 'styled-components';
import { Button as MantineButton } from '@mantine/core';
const Styled = styled(MantineButton)`color: red;`;
// 6.1.x: OK
// 6.4.2: TS2769 — `variant` and `children` do not exist on
// `FastOmit<FastOmit<{}, never> & Partial<Pick<{}, never>>, "as" | "forwardedAs">
// & { as?: WebTarget; forwardedAs?: WebTarget }`
const usage = <Styled variant="filled">hi</Styled>;Source: styled-components/styled-components