Skip to content

Instantly share code, notes, and snippets.

@alyssoncm
Last active December 30, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyssoncm/261beb70e1c48301c9491df71f8928e6 to your computer and use it in GitHub Desktop.
Save alyssoncm/261beb70e1c48301c9491df71f8928e6 to your computer and use it in GitHub Desktop.
import React, { useState } from 'react';
import { Text, TextInput, View } from 'react-native';
const Application = () => {
const [text, setText] = useState('');
function onChangeText(text) {
setText(text.replaceAll(/[0-9]/g,'X'))
}
return (
<View>
<TextInput
onChangeText={onChangeText}
value={text}
/>
<Text>
{text}
</Text>
</View>
);
}
export default Application;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment