How to register unload hooks? #29284
Unanswered
binarykitchen
asked this question in
Help
Replies: 2 comments 2 replies
-
Usually, if you use React, React's unmount method is called if you switch to another Story. Unfortunately, I don't quite understand why your component doesn't get destroyed. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm not using React. Just good old plain JavaScript. So, just using the plain HTML renderer: And it doesn't come with unmount hooks. It would be nice to have. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
When switching stories, I am unable to abort any running processes from the previous story.
I'm maintaining a UI library using getUserMedia for video recording.
Imagine a story A where the video is being recorded, and then you switch to another story B, but story A still keeps recording.
A solution would be to add some clean up function or unload hook to stop the video recording before changing to the new iFrame with the new story.
Already researched but still haven't found a clue nor a solution yet.
How to solve this?
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions