feat: type form data
This commit is contained in:
parent
fc254f3e95
commit
692e434c90
1 changed files with 15 additions and 3 deletions
|
|
@ -10,13 +10,25 @@ import { AuthNavigatorRoutesProps } from '@routes/auth.routes';
|
||||||
import { Input } from '@components/Input';
|
import { Input } from '@components/Input';
|
||||||
import { Button } from '@components/Button';
|
import { Button } from '@components/Button';
|
||||||
|
|
||||||
|
type FormDataProps = {
|
||||||
|
name: string;
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
confirmPassword: string;
|
||||||
|
};
|
||||||
|
|
||||||
export function SignUp() {
|
export function SignUp() {
|
||||||
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
const navigation = useNavigation<AuthNavigatorRoutesProps>();
|
||||||
|
|
||||||
const { control, handleSubmit } = useForm();
|
const { control, handleSubmit } = useForm<FormDataProps>();
|
||||||
|
|
||||||
function handleSignUp(data: any) {
|
function handleSignUp({ name, email, password, confirmPassword }: FormDataProps) {
|
||||||
console.debug(data);
|
console.debug({
|
||||||
|
name,
|
||||||
|
email,
|
||||||
|
password,
|
||||||
|
confirmPassword,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleGoBack = () => {
|
const handleGoBack = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue