Skip to content

Commit

Permalink
add changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jun 12, 2022
1 parent 65f4444 commit 682313b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .changeset/tall-flies-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@emotion/native': patch
'@emotion/styled': patch
---

author: @Andarist

`shouldForwardProp` has been changed from being a bivariant method to a contravariant function - it improves the type-safety for those that type this option.
6 changes: 6 additions & 0 deletions .changeset/thirty-boats-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/native': patch
'@emotion/styled': patch
---

`FilteringStyledOptions` and `StyledOptions` types no longer require a type argument for the `Props` generic.
5 changes: 1 addition & 4 deletions packages/native/types/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ export type Interpolation<
| ArrayInterpolation<MergedProps, StyleType>
| FunctionInterpolation<MergedProps, StyleType>

/**
* Same as StyledOptions but shouldForwardProp must be a type guard (https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates).
* Practical sense: you can define and reuse atomic `shouldForwardProp` filters that are strictly bound with some `ForwardedProps` type.
*/
/** Same as StyledOptions but shouldForwardProp must be a type guard */
export interface FilteringStyledOptions<
Props = Record<string, any>,
ForwardedProps extends keyof Props & string = keyof Props & string
Expand Down
5 changes: 1 addition & 4 deletions packages/styled/types/base.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ export {

export { ComponentSelector, Interpolation }

/**
* Same as StyledOptions but shouldForwardProp must be a type guard (https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates).
* Practical sense: you can define and reuse atomic `shouldForwardProp` filters that are strictly bound with some `ForwardedProps` type.
*/
/** Same as StyledOptions but shouldForwardProp must be a type guard */
export interface FilteringStyledOptions<
Props = Record<string, any>,
ForwardedProps extends keyof Props & string = keyof Props & string
Expand Down

0 comments on commit 682313b

Please sign in to comment.