Last active
December 30, 2020 20:52
-
-
Save alyssoncm/261beb70e1c48301c9491df71f8928e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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