Skip to content
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 innerRef. #426

Merged
merged 2 commits into from
Oct 23, 2017

Conversation

cameron-martin
Copy link
Contributor

Closes #424.

What:
Added innerRef prop to styled component typescript definitions.

Why:
To fix this issue: #424

How:
By adding the StyledComponentProps type, which has all the normal element props and also innerRef that is the same type as ref.

Checklist:

  • Documentation - N/a
  • Tests
  • Code complete

I'm not sure what to do about withComponent(AnotherComponent). What even is the behaviour of withComponent when called with another component?

@renatorib
Copy link
Contributor

Hey, this looks great.

But I think StyledComponentProps isn't a good name for this. I think it as something like ElementProps.
I consider that to be a StyledComponentProps it should have all props including Props and Theme

@cameron-martin
Copy link
Contributor Author

Sure, I renamed it.

@tkh44 tkh44 merged commit efecfe7 into emotion-js:master Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

innerRef is missing from react-emotion typings
4 participants