-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typing for create-emotion-styled #671
Fix typing for create-emotion-styled #671
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
One thing I forgot about last time is the shorthand, while it only works with the babel plugin, there are many people who run ts and then babel with babel-plugin-emotion so could you make this work?
styled.div(...styles)
@mitchellhamilton |
@Ailrun yes, the babel plugin does work with create-emotion-styled. |
a540650
to
1915489
Compare
[T in keyof JSX.IntrinsicElements]: CreateStyledOtherComponent<JSX.IntrinsicElements[T], Theme>; | ||
}; | ||
|
||
export interface CreateStyled<Theme extends object = any> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this needs Theme extends object = any
whereas the shorthand one doesn't need = any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitchellhamilton CreateStyled
is access point of all API, where CreateStyledShorthands
is just a base interface (well, it's not really interface, but in some way, it's similar to interface) of CreateStyled
.
Therefore, CreateStyled
is one used by user, so I put the default type on this interface only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!
What:
I do really hate global JSX namespace idea.onClick
as props.Why: Typing introduced in #668 is wrong.
How: By using
JSX.IntrinsicElements
Checklist: