Skip to content

Commit

Permalink
Migrate v1 changesets to v2 ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Mar 2, 2020
1 parent 5c63a0e commit a8c9942
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
---
'@emotion/css': major
'emotion-theming': major
'@emotion/serialize': major
'@emotion/styled-base': major
'@emotion/styled': major
---

TypeScript types have been restructured. These changes:

- Reduce build times when using emotion
Expand All @@ -20,12 +28,12 @@ If you encounter build issues after upgrade, try removing any manually specified
- `css` function has been restricted to prevent passing of invalid types
- `CreateStyled` functions no longer take a second `ExtraProps` argument. Instead move it to after the create styled call. For example

`styled<typeof MyComponent, ExtraProps>(MyComponent)({})`
to
`styled<typeof MyComponent, ExtraProps>(MyComponent)({})`
to
`styled(MyComponent)<ExtraProps>({})`

- `StyledComponent` type no longer supports the third generic `Theme` parameter. Instead add the `theme` prop to the first `Props` argument. For example:

`StyledComponent<Props, {}, MyTheme>`
to
`StyledComponent<Props, {}, MyTheme>`
to
`StyledComponent<Props & { theme?: MyTheme }>`
31 changes: 0 additions & 31 deletions .changeset/long-apes-admire/changes.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
'@emotion/styled': minor
---

Added `CreateStyled` overload to handle when `shouldForwardProp` is a custom type guard for intrinsic props.

As an example, if you want to override the type of the `color` prop:
Expand Down
4 changes: 0 additions & 4 deletions .changeset/polite-tips-attend/changes.json

This file was deleted.

0 comments on commit a8c9942

Please sign in to comment.