在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:
wenyongda 2025-07-29 15:28:14 +08:00
parent e24a04098c
commit d8520e72ec

View File

@ -572,7 +572,7 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
if (isSubmittingNow) {
handleFeedbackSubmit(null, '')
}
})
}, [])
const handleFeedbackSubmit = useCallback(
async (selectedOption: number | null, feedbackText: string) => {