storybook icon indicating copy to clipboard operation
storybook copied to clipboard

beforeUnmount now triggered when switched to docs

Open mokone91 opened this issue 2 years ago • 1 comments

Hi! Have a bug - vue beforeUnmount event not triggered when story switched from Canvas to Docs, when story switched to another - it woks as expected. What affected - I have component which use teleport vue feature, when i swiched to docs - old teleport node not removed(because of beforeUnmount) and new created, so each time when i swich canvas to docs and back - new node created..

Any solution?

mokone91 avatar Oct 03 '22 10:10 mokone91

Hello,

I have similar issue in Angular. NgOnDestroy hook is not executed when moving from canvas to docs tab. Please let me know if there is any setting or workaround.

Thanks

arsen-melkumiants avatar Oct 19 '22 13:10 arsen-melkumiants

any updates? maybe somebody have some temporary solution?

mokone91 avatar Oct 24 '22 08:10 mokone91

The only thing that helped me, as a workaround, is to make sure that docs are in inlineStories: true. Only then I see a proper lifecycle.

arsen-melkumiants avatar Oct 24 '22 08:10 arsen-melkumiants