React Native TextInput 不能输入中文 已解决

用一个基础类,让TextInput 继承这个基础类  ,判断是否是IOS系统,最后返回一个 TextInput 

直接上代码:

import React, {Component} from 'react';
import {Platform, TextInput} from 'react-native';


export default class LLTextInput extends Component {

    shouldComponentUpdate (nextProps){
        return Platform.OS !== 'ios'
            || (this.props.value === nextProps.value && (nextProps.defaultValue == undefined || nextProps.defaultValue == '' ))
            || (this.props.defaultValue === nextProps.defaultValue && (nextProps.value == undefined || nextProps.value == '' ));
    }


            render() {
        return <TextInput {...this.props} />;
    }
};

猜你喜欢

转载自www.cnblogs.com/hai-cheng/p/9271777.html
今日推荐