From 280e2d780055cc3452ff0f06821cb5d6727fdbe9 Mon Sep 17 00:00:00 2001 From: Matthieu Lemoine Date: Mon, 22 May 2017 17:42:42 +0200 Subject: [PATCH] :green_heart: Fix test --- src/models/StyledNativeComponent.js | 6 +++--- src/native/test/native.test.js | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/models/StyledNativeComponent.js b/src/models/StyledNativeComponent.js index 720ba2812..e1b7ac590 100644 --- a/src/models/StyledNativeComponent.js +++ b/src/models/StyledNativeComponent.js @@ -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 @@ -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) diff --git a/src/native/test/native.test.js b/src/native/test/native.test.js index b77b567ff..77221bf01 100644 --- a/src/native/test/native.test.js +++ b/src/native/test/native.test.js @@ -199,7 +199,6 @@ describe('native', () => { // $FlowFixMe expect(ref).toHaveBeenCalledWith(view.node) - expect(innerComponent.prop('innerRef')).toBe(ref) }) }) })