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() {
|
export function SignUp() {
|
||||||
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
||||||
|
|
||||||
const { control } = useForm();
|
const { control, handleSubmit } = useForm();
|
||||||
|
|
||||||
function handleSignUp() {
|
function handleSignUp(data: any) {
|
||||||
// do something again
|
console.debug(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleGoBack = () => {
|
const handleGoBack = () => {
|
||||||
|
|
@ -98,11 +98,13 @@ export function SignUp() {
|
||||||
secureTextEntry
|
secureTextEntry
|
||||||
onChangeText={onChange}
|
onChangeText={onChange}
|
||||||
value={value}
|
value={value}
|
||||||
|
onSubmitEditing={handleSubmit(handleSignUp)}
|
||||||
|
returnKeyType="send"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button title="Criar e acessar" onPress={handleSignUp} />
|
<Button title="Criar e acessar" onPress={handleSubmit(handleSignUp)} />
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
<Button title="Voltar para o login" mt="$12" variant="outline" onPress={handleGoBack} />
|
<Button title="Voltar para o login" mt="$12" variant="outline" onPress={handleGoBack} />
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue