diff --git a/types/styled-components/test/index.tsx b/types/styled-components/test/index.tsx index eaa43ee491..8e2bbd7f74 100644 --- a/types/styled-components/test/index.tsx +++ b/types/styled-components/test/index.tsx @@ -714,6 +714,24 @@ async function typedThemes() { ${themedCssWithNesting} `; + const WithProp = styled.div` + ${({ ok, theme: { color } }: { ok: boolean; theme: typeof theme }) => + ok && + css` + color: ${color}; + `} + `; + + // TS 3.7 note: this breaks when FlattenInterpolation is an interface, + // it needs to be made a recursive type to fix. + const WithPropNested = styled.div` + ${({ ok }: { ok: boolean }) => + ok && + css` + color: ${({ theme: { color } }: { theme: typeof theme }) => color}; + `} + `; + return ( <> @@ -728,6 +746,8 @@ async function typedThemes() { return theme.color; }} + + );