diff --git a/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/Libraries/Components/Keyboard/KeyboardAvoidingView.js index 6bfa6df2c..febb22205 100644 --- a/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -52,8 +52,6 @@ type State = {| bottom: number, |}; -const viewRef = 'VIEW'; - /** * View that moves out of the way when the keyboard appears by automatically * adjusting its height, position, or bottom padding. @@ -66,10 +64,13 @@ class KeyboardAvoidingView extends React.Component { _frame: ?ViewLayout = null; _subscriptions: Array = []; + viewRef: {current: React.ElementRef | null}; - state = { - bottom: 0, - }; + constructor(props: Props) { + super(props); + this.state = {bottom: 0}; + this.viewRef = React.createRef(); + } _relativeKeyboardHeight(keyboardFrame): number { const frame = this._frame; @@ -171,7 +172,7 @@ class KeyboardAvoidingView extends React.Component { } return ( { case 'position': return ( @@ -204,7 +205,7 @@ class KeyboardAvoidingView extends React.Component { case 'padding': return ( { default: return (