You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I discovered an issue with next-yak where using a styled component as a selector inside another styled component fails if the referenced component is declared after the usage, even when that usage is inside an arrow function.
This pattern should work since the arrow function is only evaluated at runtime after all components are defined:
The error seems to occur because the SWC plugin is checking for component references at compile time rather than deferring to runtime evaluation. Since JavaScript/TypeScript allow referencing variables before their declaration when they're inside functions that run later, this should be valid code
Environment:
next-yak: 4.1.0
yak-swc: 4.1.0
Node: 22.13.1
The text was updated successfully, but these errors were encountered:
I discovered an issue with next-yak where using a styled component as a selector inside another styled component fails if the referenced component is declared after the usage, even when that usage is inside an arrow function.
This pattern should work since the arrow function is only evaluated at runtime after all components are defined:
However, this produces the following error:
The error seems to occur because the SWC plugin is checking for component references at compile time rather than deferring to runtime evaluation. Since JavaScript/TypeScript allow referencing variables before their declaration when they're inside functions that run later, this should be valid code
Environment:
The text was updated successfully, but these errors were encountered: