diff --git a/src/styled.ts b/src/styled.tsx similarity index 81% rename from src/styled.ts rename to src/styled.tsx index 0edd843..6d8dd55 100644 --- a/src/styled.ts +++ b/src/styled.tsx @@ -2,8 +2,6 @@ import { createElement, FunctionComponent, ComponentClass } from "react"; import { ImageStyle, StyleProp, TextStyle, ViewStyle } from "react-native"; import { useTailwind } from "./use-tailwind"; -const isStyled = Symbol("styled"); - type StyledProps

= P & { className?: string; tw?: string; @@ -36,25 +34,17 @@ export function styled

( }`; } - Styled[isStyled] = true; - return Styled; } type StyledComponentProps

= StyledProps

& { - component: Component

& { - [isStyled]?: boolean; - }; + component: Component

; }; export function StyledComponent

({ component, ...options }: StyledComponentProps

) { - if (component[isStyled]) { - return component; - } - - return styled

(component)(options as P); + const Component = styled

(component); + return ; } -StyledComponent[isStyled] = true;