Skip to content

Commit

Permalink
Fix hooks story, by updating args reactively in decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed May 24, 2023
1 parent 9cee100 commit 9d5eed2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/renderers/vue3/src/decorateStory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export function decorateStory(
let story: VueRenderer['storyResult'] | undefined;

const decoratedStory: VueRenderer['storyResult'] = decorator((update) => {
story = decorated({
...context,
...sanitizeStoryContextUpdate(update),
});
const sanitizedUpdate = sanitizeStoryContextUpdate(update);
// update the args in a reactive way
if (update) sanitizedUpdate.args = Object.assign(context.args, sanitizedUpdate.args);
story = decorated({ ...context, ...sanitizedUpdate });
return story;
}, context);

Expand Down

0 comments on commit 9d5eed2

Please sign in to comment.