在 react-native-paper 中使用 TextInputMask 在 TextInput 上获取错误

Getting Error on TextInput with TextInputMask in react-native-paper

警告:componentWillReceiveProps 已重命名,不建议使用。看 react-unsafe-component-lifecycles 了解详情。

请更新以下组件:TextInputMask

<TextInput
    mode="outlined"
    label="Pincode"
    value={this.state.pincode}
    onChangeText={this.handlePincodeChange}
    left={<TextInput.Icon style={{marginEnd:10}} color='#156da9' name="map-marker"/>}
    style={styles.textInput}
    keyboardType='number-pad'
    render={props => 
        <TextInputMask
            {...props}
            mask="[000000]"
        />
    }
    theme={theme}
/>

这似乎是 react-native-text-input-mask 库中的一个 BUG,代码已修复,但拉取请求尚未合并,因此很可能在库自行修复之前您无法修复此问题,除非您愿意用 fix 分叉库并构建它。

PR #141

BUG 158