Skip to content

Instantly share code, notes, and snippets.

@Lunfer
Created February 4, 2022 12:57
Show Gist options
  • Save Lunfer/dd6c97bb454525945c1b6883eb6d1de7 to your computer and use it in GitHub Desktop.
Save Lunfer/dd6c97bb454525945c1b6883eb6d1de7 to your computer and use it in GitHub Desktop.
userProfileComponentSnippet
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