mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Ensure that all callbacks for useEventListener are wrapped in useCallback (#22618)
GitOrigin-RevId: 4a7c409a9720eab04fc17e5111b6a3aeeac6871d
This commit is contained in:
@@ -101,9 +101,12 @@ export const ReferencesProvider: FC = ({ children }) => {
|
||||
}
|
||||
}, [eventEmitter, fileTreeData, indexReferencesIfDocModified])
|
||||
|
||||
useEventListener('reference:added', function () {
|
||||
indexAllReferences(true)
|
||||
})
|
||||
useEventListener(
|
||||
'reference:added',
|
||||
useCallback(() => {
|
||||
indexAllReferences(true)
|
||||
}, [indexAllReferences])
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
const handleProjectJoined = () => {
|
||||
|
||||
Reference in New Issue
Block a user