import { useState } from "react" import { Image, StyleSheet } from "react-native" import { Banner, Button, HelperText, TextInput } from "react-native-paper" import { SafeAreaView } from "react-native-safe-area-context" const RegisterPage: React.FC = () => { const regexEmail = /^[\w.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,4}$/ const [password, setPassword] = useState("") const [isPasswordCorrect, setIsPasswordCorrect] = useState(true) const [isEmailValid, setIsEmailValid] = useState(true) return ( { return console.log("Pressed") }, }, ]} icon={({ size }) => { return ( ) }} > There was an error while trying to register. { setIsEmailValid(regexEmail.test(text)) }} /> {isEmailValid ? null : ( Email address is invalid! )} { setPassword(text) console.log(text) }} /> { setIsPasswordCorrect(text === password) }} /> Error message ) } const styles = StyleSheet.create({ container: { flex: 1, alignItems: "center", justifyContent: "center", }, input: { width: "80%", margin: 10, }, errorText: { margin: 10, }, }) export default RegisterPage