@samitouri / QOS-React / commits / 81bd138144

findNodeHandle -> ReactNative.findNodeHandle (#8962)

Submitted this internally already. Needed because people import this file directly and they might not have the renderer inject the findNodeHandle handler yet.

Sebastian Markbåge committed Feb 8, 2017 at 17:13 UTC 81bd138144f61640edd3cd80a48adc152ae86edb
1 file changed +8 -8
src/renderers/native/NativeMethodsMixin.js
+8 -8
@@ -11,11 +11,11 @@
11 */
12 'use strict';
13
14 +var ReactNative = require('ReactNative');
15 var ReactNativeAttributePayload = require('ReactNativeAttributePayload');
16 var TextInputState = require('TextInputState');
17 var UIManager = require('UIManager');
18
18 -var findNodeHandle = require('findNodeHandle');
19 var invariant = require('invariant');
20
21 type MeasureOnSuccessCallback = (
@@ -85,7 +85,7 @@ var NativeMethodsMixin = {
85 */
86 measure: function(callback: MeasureOnSuccessCallback) {
87 UIManager.measure(
88 - findNodeHandle(this),
88 + ReactNative.findNodeHandle(this),
89 mountSafeCallback(this, callback)
90 );
91 },
@@ -107,7 +107,7 @@ var NativeMethodsMixin = {
107 */
108 measureInWindow: function(callback: MeasureInWindowOnSuccessCallback) {
109 UIManager.measureInWindow(
110 - findNodeHandle(this),
110 + ReactNative.findNodeHandle(this),
111 mountSafeCallback(this, callback)
112 );
113 },
@@ -118,7 +118,7 @@ var NativeMethodsMixin = {
118 * are relative to the origin x, y of the ancestor view.
119 *
120 * As always, to obtain a native node handle for a component, you can use
121 - * `React.findNodeHandle(component)`.
121 + * `ReactNative.findNodeHandle(component)`.
122 */
123 measureLayout: function(
124 relativeToNativeNode: number,
@@ -126,7 +126,7 @@ var NativeMethodsMixin = {
126 onFail: () => void /* currently unused */
127 ) {
128 UIManager.measureLayout(
129 - findNodeHandle(this),
129 + ReactNative.findNodeHandle(this),
130 relativeToNativeNode,
131 mountSafeCallback(this, onFail),
132 mountSafeCallback(this, onSuccess)
@@ -150,7 +150,7 @@ var NativeMethodsMixin = {
150 );
151
152 UIManager.updateView(
153 - (findNodeHandle(this) : any),
153 + (ReactNative.findNodeHandle(this) : any),
154 this.viewConfig.uiViewClassName,
155 updatePayload
156 );
@@ -161,14 +161,14 @@ var NativeMethodsMixin = {
161 * will depend on the platform and type of view.
162 */
163 focus: function() {
164 - TextInputState.focusTextInput(findNodeHandle(this));
164 + TextInputState.focusTextInput(ReactNative.findNodeHandle(this));
165 },
166
167 /**
168 * Removes focus from an input or view. This is the opposite of `focus()`.
169 */
170 blur: function() {
171 - TextInputState.blurTextInput(findNodeHandle(this));
171 + TextInputState.blurTextInput(ReactNative.findNodeHandle(this));
172 },
173 };
174