Skip to content

Further fixes around wrapper and types#13

Merged
skovhus merged 2 commits intomainfrom
more-fixes
Jan 9, 2026
Merged

Further fixes around wrapper and types#13
skovhus merged 2 commits intomainfrom
more-fixes

Conversation

@skovhus
Copy link
Copy Markdown
Owner

@skovhus skovhus commented Jan 9, 2026

Wrapper generation for styled(ImportedComponent)

  • Internal (non-exported) styled components wrapping imported components now correctly generate wrapper functions when used in JSX
  • Preserves component props like variant, color and proper as prop handling

Type alias extension

  • Type aliases (not just interfaces) are now extended with React.ComponentProps when wrapping components
  • Added extendExistingTypeAlias() to handle intersection type generation

Static property inheritance for imported components

  • Detects static property accesses on styled components (e.g., Component.HEIGHT)
  • Generates inheritance statements from imported base components

Type preservation for style functions

  • Style function parameters now preserve imported type annotations (e.g., Colors) instead of defaulting to string

@skovhus skovhus merged commit 592aa0e into main Jan 9, 2026
1 check passed
@skovhus skovhus deleted the more-fixes branch January 9, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant