|
I was trying to do some tests but I noticed that the 'disposer' of the addDisposer system is not called when a test is done. Is there anything that would help to make the disposer happen after a test is done? I'm using jest main file test file repro here https://github.com/cmdcolin/jest-adddisposer-issue-test |
Answered by
cmdcolin
Oct 20, 2023
Replies: 2 comments
|
note that I have an odd purpose which is adding a keyboard shortcut in the afterCreate, and then ideally cleaning it up in the addDisposer callback, but i was just getting some weird test behavior due to this disposer not being called |
0 replies
|
Actually found a self answer, somewhere high up in my tree I can call destroy in a useEffect |
0 replies
Answer selected by
cmdcolin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually found a self answer, somewhere high up in my tree I can call destroy in a useEffect