Skip to content

Commit 896b9f6

Browse files
committed
fix: replace deprecated React FormEvent with SubmitEvent
React 19 deprecated FormEvent in favor of specific event types. Updated form submit handlers to use SubmitEvent.
1 parent a62fe82 commit 896b9f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/components/chat-widget/chat-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(function ChatI
3939
textarea.style.height = `${Math.min(textarea.scrollHeight, 120).toString()}px`;
4040
};
4141

42-
const handleSubmit = (e?: React.FormEvent) => {
42+
const handleSubmit = (e?: React.SubmitEvent) => {
4343
e?.preventDefault();
4444
if (!message.trim()) return;
4545
onSend?.(message);

src/components/react/Faucet/FaucetForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type FormEvent, useState } from "react";
1+
import { type SubmitEvent, useState } from "react";
22
import { Button } from "~/components/react/Button/Button";
33
import { IconCheck } from "~/components/react/Icon/IconCheck";
44
import { IconWarning } from "~/components/react/Icon/IconWarning";
@@ -24,7 +24,7 @@ export function FaucetForm({ user }: FaucetFormProps) {
2424
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
2525
const [error, setError] = useState<string | null>(null);
2626

27-
const handleFaucetRequest = async (e: FormEvent) => {
27+
const handleFaucetRequest = async (e: SubmitEvent) => {
2828
e.preventDefault();
2929
setError(null);
3030
setIsSubmitting(true);

0 commit comments

Comments
 (0)