In react-native above, TextInput cannot enter Chinese in the iOS platform has been resolved.
But native-base
there are problems with both input and textarea. In order not to write multiple components, encapsulate the following code:
import React from ‘react‘;import PropTypes from ‘prop-types‘;import { Platform,} from ‘react-native‘;import { Textarea, Input,} from ‘native-base‘;export const inputSupportLanguage = (WrappedComponent) => { class InputSupportLanguage extends React.Component { shouldComponentUpdate(nextProps) { const { value, defaultValue } = this.props; return Platform.OS !== ‘ios‘ || (value === nextProps.value && !nextProps.defaultValue) || (defaultValue === nextProps.defaultValue && !nextProps.value); } render() { return <WrappedComponent {...this.props} />; } } InputSupportLanguage.propTypes = { value: PropTypes.string, defaultValue: PropTypes.string, }; return InputSupportLanguage;};export const NBInput = inputSupportLanguage(Input);export const NBTextarea = inputSupportLanguage(Textarea);
In the corresponding file, you can import the components you need to use, like using input and textarea in native-base. eg
import { NBInput, NBTextarea,} from ‘utils/inputSupportLanguage‘;
Native-base Input,textarea and other components cannot be entered in Chinese under iOS platform