Files
react-native/Libraries/Components/TextInput/RCTMultilineTextInputNativeComponent.js
T
Samuel Susla 6449cc4363 Implement setMostRecentEventCount and setTextAndSelection commands in TextInput
Summary:
Implements JS interface and commands in native, however it isn't connected anywhere.
Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19471025

fbshipit-source-id: 7ec53c04b38cb27b84ef06dea7a0fdb9e1deee60
2020-01-22 05:12:11 -08:00

51 lines
1.4 KiB
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 type {Int32} from '../../Types/CodegenTypes';
import * as React from 'react';
type NativeType = HostComponent<mixed>;
interface NativeCommands {
+focus: (viewRef: React.ElementRef<NativeType>) => void;
+blur: (viewRef: React.ElementRef<NativeType>) => void;
+setMostRecentEventCount: (
viewRef: React.ElementRef<NativeType>,
eventCount: Int32,
) => void;
+setTextAndSelection: (
viewRef: React.ElementRef<NativeType>,
mostRecentEventCount: Int32,
value: ?string, // in theory this is nullable
start: Int32,
end: Int32,
) => void;
}
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
supportedCommands: [
'focus',
'blur',
'setMostRecentEventCount',
'setTextAndSelection',
],
});
const SinglelineTextInputNativeComponent: HostComponent<mixed> = requireNativeComponent<mixed>(
'RCTMultilineTextInputView',
);
export default SinglelineTextInputNativeComponent;