Skip to content

Tanstack: Export TanStackPreview from @storybook/tanstack-react to unblock CSF Next typing#34949

Open
Copilot wants to merge 2 commits into
nextfrom
copilot/fix-csf-next-export-tanstack-preview
Open

Tanstack: Export TanStackPreview from @storybook/tanstack-react to unblock CSF Next typing#34949
Copilot wants to merge 2 commits into
nextfrom
copilot/fix-csf-next-export-tanstack-preview

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 28, 2026

@storybook/tanstack-react exposed definePreview() returning TanStackPreview<...>, but TanStackPreview itself was not exported. In consumer projects, this made declaration emit fail with TS4023 when exporting a preview value.

  • Type export alignment

    • Exported TanStackPreview from the framework entrypoint so the public return type of definePreview() is externally nameable.
    • File: code/frameworks/tanstack-react/src/index.ts
  • Public API impact

    • No runtime behavior changes.
    • Type-only API correction for CSF Next users generating declarations.
import { definePreview } from '@storybook/tanstack-react';

export const preview = definePreview({});
// now resolves to an exported TanStackPreview<...> type

Summary by CodeRabbit

  • New Features
    • TanStackPreview interface is now publicly exported for use in external projects.

Review Change Stack

Co-authored-by: valentinpalkovic <5889929+valentinpalkovic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue with TanstackPreview export in CSF Next Export TanStackPreview from @storybook/tanstack-react to unblock CSF Next typing May 28, 2026
Copilot AI requested a review from valentinpalkovic May 28, 2026 09:48
@huang-julien huang-julien marked this pull request as ready for review May 28, 2026 13:04
@huang-julien huang-julien changed the title Export TanStackPreview from @storybook/tanstack-react to unblock CSF Next typing Tanstack: Export TanStackPreview from @storybook/tanstack-react to unblock CSF Next typing May 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Fails
🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against 180522f

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d7a5cb0d-1bb2-4e75-85f7-51e3a744fa79

📥 Commits

Reviewing files that changed from the base of the PR and between ff317d8 and 180522f.

📒 Files selected for processing (1)
  • code/frameworks/tanstack-react/src/index.ts

📝 Walkthrough

Walkthrough

The TanStackPreview interface in the TanStack React framework module is changed from an internal declaration to an explicitly exported public type by adding the export keyword to its interface declaration on line 102.

Changes

TanStackPreview public API

Layer / File(s) Summary
Export TanStackPreview interface
code/frameworks/tanstack-react/src/index.ts
The TanStackPreview interface declaration is made explicitly exported by adding the export keyword, changing the interface from internal module scope to a public exported type.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

  • #34935: This PR directly addresses the missing exported TanStackPreview type, which is the root cause of the reported TS4023 "type cannot be named" error.

Possibly related PRs

  • storybookjs/storybook#33785: Exports the NextPreview interface in its respective src/index.ts file with identical structural intent to make a preview interface public.
  • storybookjs/storybook#32915: Exports ReactMeta interface to make previously non-exported TypeScript types public in their module.
  • storybookjs/storybook#33216: Re-exports missing public types in index.ts to resolve "type cannot be named" portability errors, same category of fix as this PR.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: @storybook/tanstack-react - CSF next support not exported type

3 participants