Skip to content

Commit da7d5b0

Browse files
committed
Fix(React): Argument of type '[]' is not assignable to parameter of type 'never'.ts(2345), fixed #16
1 parent 53cd511 commit da7d5b0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import styled from '../src';
1+
import styled from '../src'
22

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

108
export default D

packages/react/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ParamsType<K extends IntrinsicElementsKeys | React.ComponentType<any>, E ex
2727
type ReturnType<K extends IntrinsicElementsKeys | React.ComponentType<any>, E extends object = object> = <F extends TemplateStringsArray | MasterExoticComponent<any> | baseType<E>>(
2828
firstParam: F,
2929
...params: F extends MasterExoticComponent<any, any>
30-
? never
30+
? []
3131
: ParamsType<K, E>
3232
) => (F extends MasterExoticComponent<any, any>
3333
? ReturnType<K, E>

0 commit comments

Comments
 (0)