Created
February 4, 2022 12:57
-
-
Save Lunfer/dd6c97bb454525945c1b6883eb6d1de7 to your computer and use it in GitHub Desktop.
userProfileComponentSnippet
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, { FC } from "react"; | |
import { TextField,Card, CardBody } from "matte-ui"; | |
import { useForm } from "react-hook-form"; | |
export interface UserProfileFormProps { | |
handleFormSubmit: any; | |
userData: any; | |
} | |
type FormData = { | |
username: string; | |
}; | |
export const UserProfileComponent: FC<UserProfileFormProps> = ({ handleFormSubmit, userData }) => { | |
const { register, handleSubmit } = useForm<FormData>(); | |
return ( | |
<div> | |
<Card> | |
<CardBody> | |
<form> | |
<TextField | |
{...register("username")} | |
id="username" | |
placeholder="your username" | |
label="Username" | |
required={true} | |
value={userData.username} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment