Skip to content

Commit

Permalink
🐛 Fix innerRef value for nested Styled Components
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Lemoine committed May 22, 2017
1 parent 932b8fb commit 9ece071
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/models/StyledNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ export default (constructWithOptions: Function) => {
}
}

onStyledRef(node: any) {
this.root = node
}

render() {
const { children, style } = this.props
const { generatedStyles } = this.state
Expand All @@ -125,10 +121,10 @@ export default (constructWithOptions: Function) => {
}

if (!isStyledComponent(target)) {
propsForElement.ref = this.onRef
propsForElement.ref = this.onRef.bind(this)
delete propsForElement.innerRef
} else {
propsForElement.ref = this.onStyledRef
propsForElement.innerRef = this.onRef.bind(this)
}

return createElement(target, propsForElement, children)
Expand Down

0 comments on commit 9ece071

Please sign in to comment.