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

Don't pass innerRef prop #80

Merged
merged 1 commit into from Jan 26, 2017
Merged

Conversation

frenic
Copy link
Collaborator

@frenic frenic commented Jan 25, 2017

As ref is omitted by React, the same thing should happen with innerRef. This example would cause "invalid prop"-warning since invalid props are not omitted when passing a component as argument to styled.

class Shared extends React.Component {
  render() {
    return <div {...this.props} />
  }
}

const Foo = styled(Shared, {
  color: 'pink',
});

<Foo innerRef={shared => shared} />

This is not an issue when the argument to styled is a string, but this PR makes sure innerRef is omitted no matter what.

@rtsao rtsao merged commit aa7a931 into styletron:master Jan 26, 2017
@rtsao
Copy link
Member

rtsao commented Jan 26, 2017

Ah, nice catch. Thanks!

@frenic frenic deleted the dont-pass-innerref branch May 22, 2017 19:58
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.

None yet

2 participants