-
-
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
Added TypeScript definitions for css prop. #416
Conversation
On seconds thoughts, maybe this should go into the dts files in the What do you think? |
It should go in the react-emotion package I think. |
@@ -3,6 +3,12 @@ import { Interpolation as EmotionInterpolation } from 'emotion' | |||
|
|||
export * from 'emotion' | |||
|
|||
declare module 'react' { | |||
interface HTMLAttributes<T> { | |||
css?: string; |
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.
This can be any type of value.
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.
Anything of type Interpolation
?
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.
Correct
I'm using react + emotion without react-emotion so it would be useful to be in the emotion package. |
I agree. @cameron-martin. I misread your original comment. Sorry about that. |
66ea2d7
to
80e54df
Compare
I've made the css prop take anything of type |
What:
Added TypeScript definitions for the
css
prop which is compiled toclassName
by the babel plugin.Why:
Because otherwise TypeScript users will get type errors when using this feature.
How:
Used module augmentation/declaration merging to add the
css
property to theHTMLAttributes
inferface.Checklist: