Add a hand-written JS view config for AndroidTextInput

Summary:
Hand-writing a JS view config for AndroidTextInputNativeComponent.

This diff was generated by adding logging to `getNativeComponentAttributes`. Diff preview: https://our.intern.facebook.com/intern/diff/view-version/96875488/

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19456328

fbshipit-source-id: b2d5abd2fde380be182b95881c335d24481343f1
This commit is contained in:
Emily Janzer
2020-01-22 14:12:22 -08:00
committed by Facebook Github Bot
parent 6871416328
commit 4dd93582b6
2 changed files with 99 additions and 4 deletions
@@ -25,6 +25,8 @@ import type {ColorValue} from '../../StyleSheet/StyleSheetTypes';
import requireNativeComponent from '../../ReactNative/requireNativeComponent';
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
import * as React from 'react';
import AndroidTextInputViewConfig from './AndroidTextInputViewConfig';
const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry');
export type KeyboardType =
// Cross Platform
@@ -563,8 +565,17 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
],
});
const AndroidTextInputNativeComponent: HostComponent<NativeProps> = requireNativeComponent<NativeProps>(
'AndroidTextInput',
);
let AndroidTextInputNativeComponent;
if (global.RN$Bridgeless) {
ReactNativeViewConfigRegistry.register('AndroidTextInput', () => {
return AndroidTextInputViewConfig;
});
AndroidTextInputNativeComponent = 'AndroidTextInput';
} else {
AndroidTextInputNativeComponent = requireNativeComponent<NativeProps>(
'AndroidTextInput',
);
}
export default AndroidTextInputNativeComponent;
// flowlint-next-line unclear-type:off
export default ((AndroidTextInputNativeComponent: any): HostComponent<NativeProps>);