From 7e7f6bb317abcf324849ec66b2e97d98622e8f83 Mon Sep 17 00:00:00 2001 From: Bart van den Aardweg Date: Mon, 10 May 2021 17:59:14 +0200 Subject: [PATCH] fix(story): prevent returning of different story --- src/bridge/useStory.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bridge/useStory.ts b/src/bridge/useStory.ts index 6432a8c..50516db 100644 --- a/src/bridge/useStory.ts +++ b/src/bridge/useStory.ts @@ -11,5 +11,7 @@ export const useStory = (newStory: Story) => { context?.setStory(newStory); }, [newStory]); - return context?.story === undefined ? newStory : context?.story; + return context?.story === undefined || newStory?.uuid !== context?.story?.uuid + ? newStory + : context?.story; };