Skip to content
Discussion options

You must be logged in to vote

This error is expected—Storybook hooks like useArgs (and functions like updateArgs/setArgs) can only be used inside story functions or decorators, not inside Angular component code or event handlers. In Angular stories, updateArgs is not reliably available in the context object by default, which is why you see it as undefined or missing in your render function context. This is a known limitation in Storybook 9.x for Angular and is being worked on for future releases [source].

To work around this and enable syncing component state with Storybook controls, you can add a decorator in your .storybook/preview.ts that injects updateArgs into the story context. Here’s how you can do it:

// .sto…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NoNamer777
Comment options

@dosubot
Comment options

Answer selected by NoNamer777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant