Created
December 30, 2020 20:46
-
-
Save alyssoncm/1a26f132bcc5493c08cc4aeefd45ce75 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 { Button, Text, TextInput, View } from 'react-native'; | |
export default function Application() { | |
const [text, setText] = useState(''); | |
const [enableSecure, setEnableSecure] = useState(true); | |
function toggleSecure() { | |
setEnableSecure(value => !value) | |
} | |
return ( | |
<View> | |
<TextInput | |
secureTextEntry={enableSecure} | |
onChangeText={text => setText(text)} | |
defaultValue={text} | |
/> | |
<Text> | |
{text} | |
</Text> | |
<Button onPress={toggleSecure}> | |
Toggle secure text | |
</Button> | |
</View> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment