-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Type of issue:
potential bug in type definition file
Expected behavior:
No type errors
Solution that I've found:
In the type definition file, if you change the args type (Arg[] to Arg), the type error is fixed.
Current Type Definition file:
interface DynamicStyleFunction {
(...args: Arg[]): DynamicStyle[];
}After my fix:
interface DynamicStyleFunction {
(...args: Arg): DynamicStyle[];
}To reproduce:
const mq = facepaint([
'@media(max-width: 767px)',
'@media(min-width: 768px)',
])
const Background = styled.div<{ src: string }>`
${({ src }) =>
mq({
background: [null, null, `url(${src}) no-repeat`],
backgroundSize: [null, null, '100% 100%'],
filter: [null, null, 'blur(10px)'],
})
}`Environment information:
react v16.12.0
@emotion/core v10.0.27
@emotion/styled v10.0.27
facepaint v1.2.1
@types/facepaint v1.2.1
Metadata
Metadata
Assignees
Labels
No labels
