Skip to content

Commit

Permalink
fix:change event type to fix typescript error on handleSubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
manglebot committed Jan 7, 2024
1 parent cafda8a commit 5f73258
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions client/src/components/confession/confession.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState } from "react";
import { Url, UrlObject } from "url";

const Confession: React.FC = () => {
const [formData, setFormData] = useState({
Expand All @@ -26,9 +25,7 @@ const Confession: React.FC = () => {
}
};

const handleSubmit = (
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>
) => {
const handleSubmit = (e: React.FormEvent<HTMLElement>) => {
e.preventDefault();
if (formData.subject === "" || formData.message === "") {
setErrorMessage("Please fill out all required fields.");
Expand All @@ -37,7 +34,7 @@ const Confession: React.FC = () => {
setErrorMessage("");
};

const isFormValid = formData.subject !== "" && formData.message !== "";
// const isFormValid = formData.subject !== "" && formData.message !== "";

return (
<div>
Expand Down

0 comments on commit 5f73258

Please sign in to comment.