feat: handle submit form
This commit is contained in:
parent
f21cd9b7f9
commit
fc254f3e95
1 changed files with 6 additions and 4 deletions
|
|
@ -13,10 +13,10 @@ import { Button } from '@components/Button';
|
|||
export function SignUp() {
|
||||
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
||||
|
||||
const { control } = useForm();
|
||||
const { control, handleSubmit } = useForm();
|
||||
|
||||
function handleSignUp() {
|
||||
// do something again
|
||||
function handleSignUp(data: any) {
|
||||
console.debug(data);
|
||||
}
|
||||
|
||||
const handleGoBack = () => {
|
||||
|
|
@ -98,11 +98,13 @@ export function SignUp() {
|
|||
secureTextEntry
|
||||
onChangeText={onChange}
|
||||
value={value}
|
||||
onSubmitEditing={handleSubmit(handleSignUp)}
|
||||
returnKeyType="send"
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button title="Criar e acessar" onPress={handleSignUp} />
|
||||
<Button title="Criar e acessar" onPress={handleSubmit(handleSignUp)} />
|
||||
</Center>
|
||||
|
||||
<Button title="Voltar para o login" mt="$12" variant="outline" onPress={handleGoBack} />
|
||||
|
|
|
|||
Loading…
Reference in a new issue