Commit b9afb7b 1 parent b404175 commit b9afb7b Copy full SHA for b9afb7b
File tree 2 files changed +6
-4
lines changed
web/app/components/base/chat
chat-with-history/config-panel
embedded-chatbot/config-panel
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ import { useCallback } from 'react'
1
2
import { useTranslation } from 'react-i18next'
2
3
import { useChatWithHistoryContext } from '../context'
3
4
import Input from './form-input'
@@ -15,12 +16,12 @@ const Form = () => {
15
16
isMobile,
16
17
} = useChatWithHistoryContext ( )
17
18
18
- const handleFormChange = ( variable : string , value : any ) => {
19
+ const handleFormChange = useCallback ( ( variable : string , value : any ) => {
19
20
handleNewConversationInputsChange ( {
20
21
...newConversationInputsRef . current ,
21
22
[ variable ] : value ,
22
23
} )
23
- }
24
+ } , [ newConversationInputsRef , handleNewConversationInputsChange ] )
24
25
25
26
const renderField = ( form : any ) => {
26
27
const {
Original file line number Diff line number Diff line change
1
+ import { useCallback } from 'react'
1
2
import { useTranslation } from 'react-i18next'
2
3
import { useEmbeddedChatbotContext } from '../context'
3
4
import Input from './form-input'
@@ -15,12 +16,12 @@ const Form = () => {
15
16
isMobile,
16
17
} = useEmbeddedChatbotContext ( )
17
18
18
- const handleFormChange = ( variable : string , value : any ) => {
19
+ const handleFormChange = useCallback ( ( variable : string , value : any ) => {
19
20
handleNewConversationInputsChange ( {
20
21
...newConversationInputsRef . current ,
21
22
[ variable ] : value ,
22
23
} )
23
- }
24
+ } , [ newConversationInputsRef , handleNewConversationInputsChange ] )
24
25
25
26
const renderField = ( form : any ) => {
26
27
const {
You can’t perform that action at this time.
0 commit comments