mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
7a8e10dac8
Summary: Migrate to Native commands with Blur and Focus on TextInput. Changelog: [Internal] Reviewed By: TheSavior, shergin Differential Revision: D19412085 fbshipit-source-id: 33b29b2699bc74d31ef1b4b0e585daffd88c4140
34 lines
997 B
JavaScript
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;
|