diff --git a/Libraries/Components/ScrollResponder.js b/Libraries/Components/ScrollResponder.js index 4f8c86fc8a8cdb..8c58f75c5d5126 100644 --- a/Libraries/Components/ScrollResponder.js +++ b/Libraries/Components/ScrollResponder.js @@ -10,7 +10,6 @@ 'use strict'; -const React = require('react'); const Dimensions = require('../Utilities/Dimensions'); const FrameRateLogger = require('../Interaction/FrameRateLogger'); const Keyboard = require('./Keyboard/Keyboard'); @@ -552,30 +551,19 @@ const ScrollResponderMixin = { * @param {bool} preventNegativeScrolling Whether to allow pulling the content * down to make it meet the keyboard's top. Default is false. */ - scrollResponderScrollNativeHandleToKeyboard: function( - nodeHandle: - | number - | React.ElementRef>>, + scrollResponderScrollNativeHandleToKeyboard: function( + nodeHandle: number, additionalOffset?: number, preventNegativeScrollOffset?: boolean, ) { this.additionalScrollOffset = additionalOffset || 0; this.preventNegativeScrollOffset = !!preventNegativeScrollOffset; - - if (typeof nodeHandle === 'number') { - UIManager.measureLayout( - nodeHandle, - ReactNative.findNodeHandle(this.getInnerViewNode()), - this.scrollResponderTextInputFocusError, - this.scrollResponderInputMeasureAndScrollToKeyboard, - ); - } else { - nodeHandle.measureLayout( - this.getInnerViewRef(), - this.scrollResponderInputMeasureAndScrollToKeyboard, - this.scrollResponderTextInputFocusError, - ); - } + UIManager.measureLayout( + nodeHandle, + ReactNative.findNodeHandle(this.getInnerViewNode()), + this.scrollResponderTextInputFocusError, + this.scrollResponderInputMeasureAndScrollToKeyboard, + ); }, /** diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 0476fd9cde0634..d477cbad085bb5 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -69,7 +69,6 @@ export type ScrollResponderType = { // issue by specifying them manually. getScrollableNode: $PropertyType, getInnerViewNode: $PropertyType, - getInnerViewRef: $PropertyType, getNativeScrollRef: $PropertyType, setNativeProps: $PropertyType, @@ -769,15 +768,7 @@ class ScrollView extends React.Component { return ReactNative.findNodeHandle(this._innerViewRef); } - getInnerViewRef(): ?React.ElementRef< - Class>, - > { - return this._innerViewRef; - } - - getNativeScrollRef(): ?React.ElementRef< - Class>, - > { + getNativeScrollRef(): ?ScrollView { return this._scrollViewRef; } @@ -950,21 +941,13 @@ class ScrollView extends React.Component { this.props.onContentSizeChange(width, height); }; - _scrollViewRef: ?React.ElementRef< - Class>, - > = null; - _setScrollViewRef = ( - ref: ?React.ElementRef>>, - ) => { + _scrollViewRef: ?ScrollView = null; + _setScrollViewRef = (ref: ?ScrollView) => { this._scrollViewRef = ref; }; - _innerViewRef: ?React.ElementRef< - Class>, - > = null; - _setInnerViewRef = ( - ref: ?React.ElementRef>>, - ) => { + _innerViewRef: ?NativeMethodsMixinType = null; + _setInnerViewRef = (ref: ?NativeMethodsMixinType) => { this._innerViewRef = ref; }; diff --git a/Libraries/Components/TextInput/TextInput.js b/Libraries/Components/TextInput/TextInput.js index f05c1c8c94a6fd..94315aa884124b 100644 --- a/Libraries/Components/TextInput/TextInput.js +++ b/Libraries/Components/TextInput/TextInput.js @@ -904,12 +904,6 @@ const TextInput = createReactClass({ this._inputRef = ref; }, - getNativeRef: function(): ?React.ElementRef< - Class>, - > { - return this._inputRef; - }, - _renderIOSLegacy: function() { let textContainer; @@ -1233,10 +1227,6 @@ const TextInput = createReactClass({ class InternalTextInputType extends ReactNative.NativeComponent { clear() {} - getNativeRef(): ?React.ElementRef< - Class>, - > {} - // $FlowFixMe isFocused(): boolean {} }