Space panel should watch spaces for space name changes (#7432)
This commit is contained in:
parent
70dc03552c
commit
38634f86d1
3 changed files with 18 additions and 4 deletions
|
@ -65,6 +65,8 @@ export const useEventEmitterState = <T>(
|
|||
const handler = useCallback((...args: any[]) => {
|
||||
setValue(fn(...args));
|
||||
}, [fn]);
|
||||
// re-run when the emitter changes
|
||||
useEffect(handler, [emitter]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
useEventEmitter(emitter, eventName, handler);
|
||||
return value;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue