Skip to content

Fix storybook crashing when visiting a story directly via URL - #59

Merged
ljcl merged 1 commit into
mainfrom
fix-get-current-story-data-undefined
Sep 11, 2025
Merged

Fix storybook crashing when visiting a story directly via URL#59
ljcl merged 1 commit into
mainfrom
fix-get-current-story-data-undefined

Conversation

@ljcl

@ljcl ljcl commented Sep 11, 2025

Copy link
Copy Markdown
Owner

When following a direct link to a story getCurrentStoryData is initially undefined, accessing the story using story.id would then crash Storybook.

Resolves this by using the optional chaining operator story?.id

@changeset-bot

changeset-bot Bot commented Sep 11, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b9226d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ljcl/storybook-addon-cssprops Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ljcl
ljcl merged commit d7dc806 into main Sep 11, 2025
1 check passed
@ljcl
ljcl deleted the fix-get-current-story-data-undefined branch September 11, 2025 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant