-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Given the following files :
//Title.ts
const Title = styled.h1`
color: red;
`;
export default Title
//Card.ts
import Title from "./Title.ts"
const Card = styled.div`
${Title} {
color: blue;
}
`
The following css is generated :
.title-fgy45 {
color: red;
}
.title-rt5bY {
undefined {
color: blue;
}
}
next-yak
do not "understand" that the Title
component is exported (probably because of the default export indirection), and the /*YAK EXPORTED STYLED:...*/
comment is missing (the comment with the extracted CSS is there though).
This means that the loader can't resolve Title
in Card.ts
as a styled component. Instead there is only a styled-component with no className (since it was not generated by next-yak
), so we end up with an undefined
in the css.
Mad-Kat