Skip to content

frontend: AppContainer.stories: rename withEnv to WithEnv to fix rules-of-hooks#5210

Open
jedbillyb wants to merge 3 commits intokubernetes-sigs:mainfrom
jedbillyb:fix/appcontainer-stories-rules-of-hooks
Open

frontend: AppContainer.stories: rename withEnv to WithEnv to fix rules-of-hooks#5210
jedbillyb wants to merge 3 commits intokubernetes-sigs:mainfrom
jedbillyb:fix/appcontainer-stories-rules-of-hooks

Conversation

@jedbillyb
Copy link
Copy Markdown

Fixes #5184

Renames withEnv decorator to WithEnv (PascalCase) so React
recognises it as a component and hooks are valid per rules-of-hooks.

Steps to test:

  • Run npx eslint src/components/App/AppContainer.stories.tsx - no warnings

@k8s-ci-robot k8s-ci-robot requested review from sniok and yolossn April 23, 2026 11:09
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jedbillyb
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 23, 2026
@illume illume requested a review from Copilot April 23, 2026 13:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an ESLint react-hooks/rules-of-hooks warning in the Storybook story for AppContainer by renaming a hooks-using decorator to PascalCase so it is treated as a React component by the hooks rules.

Changes:

  • Renamed the Storybook decorator withEnv to WithEnv.
  • Updated the story’s decorators array to reference WithEnv.

Copy link
Copy Markdown
Contributor

@skoeva skoeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you squash the merge commits in this PR? these docs should be helpful

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

4 participants