在useEffect hooks中传递第二个参数 空数组,尝试解决 Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. 报错问题
This commit is contained in:
parent
e24a04098c
commit
d8520e72ec
@ -572,7 +572,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||||||
if (isSubmittingNow) {
|
if (isSubmittingNow) {
|
||||||
handleFeedbackSubmit(null, '')
|
handleFeedbackSubmit(null, '')
|
||||||
}
|
}
|
||||||
})
|
}, [])
|
||||||
|
|
||||||
const handleFeedbackSubmit = useCallback(
|
const handleFeedbackSubmit = useCallback(
|
||||||
async (selectedOption: number | null, feedbackText: string) => {
|
async (selectedOption: number | null, feedbackText: string) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user