Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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