mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Add supoprt for Text Input view configs
Summary: This diff adds TextInput in the list of components that support static view configs changelog: [internal] Reviewed By: yungsters Differential Revision: D26040854 fbshipit-source-id: d6b5d3a78ef4657acf3f2c4ebe527ad4ca40bcb5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e68cf7cee9
commit
4cdafd997a
@@ -26,7 +26,7 @@ import requireNativeComponent from '../../ReactNative/requireNativeComponent';
|
||||
import codegenNativeCommands from '../../Utilities/codegenNativeCommands';
|
||||
import type {TextInputNativeCommands} from './TextInputNativeCommands';
|
||||
import AndroidTextInputViewConfig from './AndroidTextInputViewConfig';
|
||||
const ReactNativeViewConfigRegistry = require('../../Renderer/shims/ReactNativeViewConfigRegistry');
|
||||
import * as NativeComponentRegistry from '../../NativeComponent/NativeComponentRegistry';
|
||||
|
||||
export type KeyboardType =
|
||||
// Cross Platform
|
||||
@@ -545,17 +545,10 @@ export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['focus', 'blur', 'setTextAndSelection'],
|
||||
});
|
||||
|
||||
let AndroidTextInputNativeComponent;
|
||||
if (global.RN$Bridgeless) {
|
||||
ReactNativeViewConfigRegistry.register('AndroidTextInput', () => {
|
||||
return AndroidTextInputViewConfig;
|
||||
});
|
||||
AndroidTextInputNativeComponent = 'AndroidTextInput';
|
||||
} else {
|
||||
AndroidTextInputNativeComponent = requireNativeComponent<NativeProps>(
|
||||
'AndroidTextInput',
|
||||
);
|
||||
}
|
||||
let AndroidTextInputNativeComponent = NativeComponentRegistry.get<NativeProps>(
|
||||
'AndroidTextInput',
|
||||
() => AndroidTextInputViewConfig,
|
||||
);
|
||||
|
||||
// flowlint-next-line unclear-type:off
|
||||
export default ((AndroidTextInputNativeComponent: any): HostComponent<NativeProps>);
|
||||
|
||||
Reference in New Issue
Block a user