diff --git a/packages/next-yak/runtime/styled.tsx b/packages/next-yak/runtime/styled.tsx index b4214bad..4a0af414 100644 --- a/packages/next-yak/runtime/styled.tsx +++ b/packages/next-yak/runtime/styled.tsx @@ -257,28 +257,21 @@ type StyledLiteral = ( * `; * ``` */ -export const styled = - // The proxy adds the styled.div, styled.button, etc. syntax - new Proxy( - StyledFactory as typeof StyledFactory & { - [Tag in HtmlTags]: StyledLiteral & { - attrs: < - TAttrsIn extends object = {}, - TAttrsOut extends AttrsMerged< - JSX.IntrinsicElements[Tag], - TAttrsIn - > = AttrsMerged, - >( - attrs: Attrs, - ) => StyledLiteral>; - }; - }, - { - get(target, TagName: keyof JSX.IntrinsicElements) { - return target(TagName); - }, - }, - ); +export const styled = StyledFactory as + // this type is wrong - but it will work correctly with compiled code + typeof StyledFactory & { + [Tag in HtmlTags]: StyledLiteral & { + attrs: < + TAttrsIn extends object = {}, + TAttrsOut extends AttrsMerged< + JSX.IntrinsicElements[Tag], + TAttrsIn + > = AttrsMerged, + >( + attrs: Attrs, + ) => StyledLiteral>; + }; + }; /** * Remove all entries that start with a $ sign