Skip to content

Commit

Permalink
Fix(React): Argument of type '[]' is not assignable to parameter of t…
Browse files Browse the repository at this point in the history
…ype 'never'.ts(2345), fixed #16
  • Loading branch information
BenSeage committed Mar 4, 2024
1 parent 53cd511 commit da7d5b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/react/e2e/ExtendMultipleStyledElements.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import styled from '../src';
import styled from '../src'

const A = styled.p`a`
const B = styled.p`b`
const C = styled.p`c`
// todo: fix the issue with the following line
// @ts-expect-error
const D = styled(A)(B)(C)`d`

export default D
2 changes: 1 addition & 1 deletion packages/react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type ParamsType<K extends IntrinsicElementsKeys | React.ComponentType<any>, E ex
type ReturnType<K extends IntrinsicElementsKeys | React.ComponentType<any>, E extends object = object> = <F extends TemplateStringsArray | MasterExoticComponent<any> | baseType<E>>(
firstParam: F,
...params: F extends MasterExoticComponent<any, any>
? never
? []
: ParamsType<K, E>
) => (F extends MasterExoticComponent<any, any>
? ReturnType<K, E>
Expand Down

0 comments on commit da7d5b0

Please sign in to comment.