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

innerRef is missing from react-emotion typings #424

Closed
tkh44 opened this issue Oct 20, 2017 · 3 comments · Fixed by #426
Closed

innerRef is missing from react-emotion typings #424

tkh44 opened this issue Oct 20, 2017 · 3 comments · Fixed by #426

Comments

@tkh44
Copy link
Member

tkh44 commented Oct 20, 2017

From twitter.

https://twitter.com/rossipedia/status/921138316677976064

I don't know much about TS so I need outside help on this one.

cc @cameron-martin @renatorib

@cameron-martin
Copy link
Contributor

What's innerRef?

@RafalFilipek
Copy link

RafalFilipek commented Oct 21, 2017

innerRef allows you to get reference to inner component.

const MyEmotionComponent   = styled('div')`color:red`;
let myRef;

<MyEmotionComponent  ref={(ref) => myRef = ref} /> // myRef - MyEmotionComponent 
<MyEmotionComponent  innerRef={(ref) => myRef = ref} /> //  myRef - div element

While we're talking abut extra props for components, there is also css prop.

@cameron-martin
Copy link
Contributor

I'm doing the TypeScript definitions for them now and I'll send a PR in a sec.

While we're talking abut extra props for components, there is also css prop.

Definitions for the css prop were added here: #416

cameron-martin added a commit to cameron-martin/emotion that referenced this issue Oct 21, 2017
cameron-martin added a commit to cameron-martin/emotion that referenced this issue Oct 22, 2017
tkh44 pushed a commit that referenced this issue 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 a pull request may close this issue.

3 participants