UNPKG

react-native-ui-lib

Version:

<p align="center"> <img src="https://user-images.githubusercontent.com/1780255/105469025-56759000-5ca0-11eb-993d-3568c1fd54f4.png" height="250px" style="display:block"/> </p> <p align="center">UI Toolset & Components Library for React Native</p> <p a

33 lines (28 loc) 1.08 kB
import React from 'react'; import { requireNativeComponent } from 'react-native'; import TextInputKeyboardManager from "../TextInputKeyboardManager/TextInputKeyboardManager.android"; import KeyboardRegistry from "../KeyboardRegistry"; import CustomKeyboardViewBase from "../CustomKeyboardViewBase"; const CustomKeyboardViewNativeAndroid = requireNativeComponent('CustomKeyboardViewNativeTemp'); export default class CustomKeyboardView extends CustomKeyboardViewBase { static displayName = 'IGNORE'; async componentDidUpdate(prevProps) { const { component } = this.props; if (prevProps.component !== component && !component) { await TextInputKeyboardManager.reset(); } super.componentDidUpdate(prevProps); } render() { const { component, initialProps } = this.props; const KeyboardComponent = component && KeyboardRegistry.getKeyboard(component); return <CustomKeyboardViewNativeAndroid> {KeyboardComponent && <KeyboardComponent {...initialProps} />} </CustomKeyboardViewNativeAndroid>; } }