UNPKG

react-native-masked-text

Version:

Text and TextInput with mask for React Native applications

25 lines (20 loc) 427 B
import React, { Component } from 'react'; import { StyleSheet, Text } from 'react-native'; import BaseTextComponent from './base-text-component'; const TEXT_REF = '$text'; export default class TextMask extends BaseTextComponent { constructor(props) { super(props); } getElement() { return this.refs[TEXT_REF]; } render() { return ( <Text ref={TEXT_REF} {...this.props}>{this.state.value}</Text> ); } }