Files
react-native/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js
T
Samuel Susla 7a8e10dac8 Use commands to send focus and blur to TextInput
Summary:
Migrate to Native commands with Blur and Focus on TextInput.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412085

fbshipit-source-id: 33b29b2699bc74d31ef1b4b0e585daffd88c4140
2020-01-20 03:08:23 -08:00

34 lines
997 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
*/
'use strict';
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
import * as React from 'react';
type NativeType = HostComponent<mixed>;
interface NativeCommands {
+focus: (viewRef: React.ElementRef<NativeType>) => void;
+blur: (viewRef: React.ElementRef<NativeType>) => void;
}
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: ['focus', 'blur'],
});
const SinglelineTextInputNativeComponent: HostComponent<mixed> = requireNativeComponent<mixed>(
'RCTMultilineTextInputView',
);
export default SinglelineTextInputNativeComponent;