Skip to content

TanStack: Add strictMode to FrameworkOptions type - #36712

Open
BaconMan1168 wants to merge 1 commit into
storybookjs:nextfrom
BaconMan1168:fix/tanstack-react-strict-mode-type
Open

BaconMan1168 wants to merge 1 commit into
storybookjs:nextfrom
BaconMan1168:fix/tanstack-react-strict-mode-type

Conversation

@BaconMan1168

Copy link
Copy Markdown
Contributor

Closes #36711

What I did

Added strictMode?: boolean to the FrameworkOptions type in @storybook/tanstack-react, matching @storybook/react-vite.

The option already works at runtime. builder-vite writes the framework options into FRAMEWORK_OPTIONS, and the React renderer reads strictMode from there. Only the type was missing, so framework: { name: '@storybook/tanstack-react', options: { strictMode: true } } failed to typecheck with TS2353.

This PR was drafted with AI assistance (Claude Code). I reviewed the change and stand behind it.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

  1. Add a file to code/frameworks/tanstack-react/src/ containing:
    import type { StorybookConfig } from './types.ts';
    
    export const config: StorybookConfig = {
      stories: [],
      framework: { name: '@storybook/tanstack-react', options: { strictMode: true } },
    };
  2. Run yarn nx check tanstack-react.
  3. Confirm there are no type errors. On next this reports TS2353: 'strictMode' does not exist in type 'FrameworkOptions'.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫

PR is not labeled with one of: ["ci:normal","ci:merged","ci:daily","ci:docs"]

🚫

PR is not labeled with one of: ["qa:needed","qa:skip","qa:success"]

🚫 This PR needs an approving review from a Storybook Core or Developer Experience team member before it can be merged. No approvals found.

Generated by 🚫 dangerJS against b21bb7c

@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1200ec6e-3d84-4b32-8831-34a59522b9f2

📥 Commits

Reviewing files that changed from the base of the PR and between 3539911 and b21bb7c.


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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



Walkthrough

TanStack React FrameworkOptions now includes the optional strictMode boolean, documented for rendering stories inside React.StrictMode.

Changes

Framework options

Layer / File(s) Summary
Declare the strictMode option
code/frameworks/tanstack-react/src/types.ts
FrameworkOptions now declares the optional strictMode boolean and documents its use for rendering stories inside React.StrictMode.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to b21bb

The new option type matches the existing runtime behavior. No actionable merge risk remains.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@storybook-contribution-review storybook-contribution-review Bot added bug review:verified Three-step review passed: architecture, code quality, runtime verification sev:S4 Low priority. Wait for community PRs. tanstack typescript labels Oct 10, 2026
@storybook-contribution-review

Copy link
Copy Markdown

🤖 I am the Storybook contribution review bot; a human maintainer approved this message before it was posted.
Review phase: Runtime verification (stage 3 of 3)

We are trying a three-stage automated review: architecture, code quality, and runtime verification. This message states which stages ran and which were skipped. A human maintainer approves each public message and makes the final decision. Please tell us whether the feedback and evidence are useful.

Thanks for the quick fix, @BaconMan1168! Adding strictMode to the TanStack React FrameworkOptions type is exactly what #36711 asked for.

Stages: architecture (stage 1) and code quality (stage 2) were skipped because the change is a two-line optional type field. Runtime verification (stage 3) ran on b21bb7c.

What we checked:

  • Type check: a main.ts with framework: { name: '@storybook/tanstack-react', options: { strictMode: true } } fails on the base commit with TS2353: 'strictMode' does not exist in type 'FrameworkOptions' and passes on this branch.
  • The option works at runtime: in a storybook dev render with @storybook/tanstack-react, strictMode: true puts strictMode: true in window.FRAMEWORK_OPTIONS, and React runs a story's mount effect twice (once without the option). So the new type describes a real option, not a no-op.
  • Tests: the tanstack-react Vitest suite passes (91/91).

Not covered: a production storybook build, React 19, the Vitest addon / portable-stories path, and a full TanStack Router sandbox.

A maintainer will make the final decision on merging.

This branch has not been deployed

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

Labels

agent-scan:mixed bug review:verified Three-step review passed: architecture, code quality, runtime verification sev:S4 Low priority. Wait for community PRs. tanstack typescript

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug]: @storybook/tanstack-react's FrameworkOptions has no strictMode

1 participant