Skip to content

Commit

Permalink
refactor: handleSubmit type add React KeyboardEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
swgvenghy committed Oct 30, 2024
1 parent f53d9e1 commit 8669db7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/hooks/use-chat-form.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// src/hooks/useChatForm.ts
import { useState, useCallback } from 'react';
import { useAutoComplete } from './use-auto-complete.hooks';
import useChatStore from '../store/chat-store';
Expand Down Expand Up @@ -46,7 +45,7 @@ const useChatForm = () => {
};

const handleSubmit = useCallback(
async (e: React.FormEvent<HTMLFormElement>) => {
async (e: React.FormEvent<HTMLFormElement> | React.KeyboardEvent<HTMLTextAreaElement>) => {
e.preventDefault();
try {
addMessage({ content, role: 'user' });
Expand Down

0 comments on commit 8669db7

Please sign in to comment.