Skip to content

fix: mark Storybook generated View import as type-only#895

Merged
dannyhw merged 2 commits into
storybookjs:nextfrom
saseungmin:fix/verbatim-module-syntax-imports
Jun 2, 2026
Merged

fix: mark Storybook generated View import as type-only#895
dannyhw merged 2 commits into
storybookjs:nextfrom
saseungmin:fix/verbatim-module-syntax-imports

Conversation

@saseungmin
Copy link
Copy Markdown
Contributor

@saseungmin saseungmin commented Jun 2, 2026

Issue:

Generated storybook.requires.ts imports View as a runtime binding even though it is only used as a TypeScript type. This causes TypeScript errors in projects using verbatimModuleSyntax: true.

What I did

Marked the generated View import as type-only:

import { start, updateView, type View, type Features } from '@storybook/react-native';

Updated the generator snapshot tests to match the new output.

How to test

Run:

pnpm --filter @storybook/tests test

I also verified the React Native package type check:

pnpm --filter @storybook/react-native check:types
  • Does this need a new example in examples/expo-example?

    • No. This only changes the generated TypeScript import syntax and does not add new behavior.
  • Does this need an update to the documentation?

    • No. This is a compatibility fix for verbatimModuleSyntax and does not change user-facing APIs or setup steps.

@saseungmin saseungmin requested a review from dannyhw as a code owner June 2, 2026 03:23
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 2, 2026

🦋 Changeset detected

Latest commit: ffaf8b7

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

This PR includes changesets to release 9 packages
Name Type
@storybook/react-native Patch
@storybook/react-native-ui Patch
@storybook/react-native-ui-lite Patch
@storybook/react-native-ui-common Patch
@storybook/react-native-theming Patch
@storybook/addon-ondevice-actions Patch
@storybook/addon-ondevice-backgrounds Patch
@storybook/addon-ondevice-controls Patch
@storybook/addon-ondevice-notes 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

@dannyhw dannyhw merged commit ce3eb7b into storybookjs:next Jun 2, 2026
1 check passed
@dannyhw
Copy link
Copy Markdown
Member

dannyhw commented Jun 2, 2026

Thanks!

@saseungmin saseungmin deleted the fix/verbatim-module-syntax-imports branch June 3, 2026 05:22
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.

2 participants