mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
fix: use ref not set init value
This commit is contained in:
@ -43,7 +43,7 @@ const defaultSubcribeOption: UseSubcribeOption = {
|
||||
function useMitt<Events extends _Events>(
|
||||
mitt?: Emitter<Events>,
|
||||
): UseMittReturn<Events> {
|
||||
const emitterRef = useRef<Emitter<Events>>()
|
||||
const emitterRef = useRef<Emitter<Events> | undefined>(undefined)
|
||||
if (!emitterRef.current)
|
||||
emitterRef.current = mitt ?? create<Events>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user