Skip to content

Release 8.0.0

Choose a tag to compare

@theo-mesnil theo-mesnil released this 12 Mar 09:50
· 606 commits to main since this release

Version 8: XStyled and styled-component upgrades

Welcome UI V8 upgrades:

  • @xstyled/styled-component to v4
  • styled-components to v6

This upgrade is a major version because it includes breaking changes.

Version 8 illustration

Upgrade steps

1. Upgrade your dependencies

Upgrade @xstyled/styled-components and styled-component packages:

yarn upgrade @xstyled/styled-components@^4.0.0 styled-components@^6.1.15

2. Remove useless dependency

Remove @types/styled-components package (types are now included in styled-components v6):

yarn remove @types/styled-components

3. Script to migrate

In welcome-ui repository, run this script:

yarn migrate '../your_project_path/**/*.{ts,tsx}'

This not cover all changes, so please check:

  • Move typescript on styled component
+ export const Component = styled.divBox<{ property: string }>(
+ ({ property }) => css`
- export const Component = styled.divBox(
-   ({ property }: {property: string }) => css`
  • Use styled.*Box instead of styled.* with ${system} pattern (The definition of the return type of the styled function has change)
+ export const Component = styled.spanBox`
- export const Component = styled.span`
-   ${system}