Skip to content

Commit

Permalink
💚 Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Lemoine committed May 22, 2017
1 parent 9ece071 commit 280e2d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/models/StyledNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default (constructWithOptions: Function) => {
this.root.setNativeProps(nativeProps)
}

onRef(node: any) {
onRef = (node: any) => {
const { innerRef } = this.props
this.root = node

Expand All @@ -121,10 +121,10 @@ export default (constructWithOptions: Function) => {
}

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

return createElement(target, propsForElement, children)
Expand Down
1 change: 0 additions & 1 deletion src/native/test/native.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe('native', () => {

// $FlowFixMe
expect(ref).toHaveBeenCalledWith(view.node)
expect(innerComponent.prop('innerRef')).toBe(ref)
})
})
})

0 comments on commit 280e2d7

Please sign in to comment.