Skip to content

Fix strict mode storybook#3837

Closed
LFDanLu wants to merge 1 commit into
mainfrom
fix_strict_mode_storybook
Closed

Fix strict mode storybook#3837
LFDanLu wants to merge 1 commit into
mainfrom
fix_strict_mode_storybook

Conversation

@LFDanLu
Copy link
Copy Markdown
Member

@LFDanLu LFDanLu commented Dec 12, 2022

Use this branch for strict mode testing + fixes for now. Will explore fixing this via the strict mode toggle PR

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

RSP

without this change we get a constant rendered more hooks than last render error
Comment thread .storybook/preview.js

export const decorators = [
Story => (
story => (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you know, we can probably get rid of this decorator, there are story options that do this now using layout: center
https://storybook.js.org/docs/react/configure/story-layout

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will investigate this option later for the decorator I'll be adding to support scrolling in all stories

@LFDanLu LFDanLu changed the title (DNM) Fix strict mode storybook Fix strict mode storybook Dec 20, 2022
Comment thread .storybook/preview.js
story => (
<VerticalCenter style={{alignItems: 'center', minHeight: '100vh', boxSizing: 'border-box', display: 'flex', justifyContent: 'center'}}>
<Story />
{story()}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

didn't we make this change originally because it was crashing storybook as you have it now?

@LFDanLu
Copy link
Copy Markdown
Member Author

LFDanLu commented Dec 20, 2022

I confused myself and Rob haha, this PR is no longer needed, superceded by #3333 now that I've got that one working

@LFDanLu LFDanLu closed this Dec 20, 2022
@LFDanLu LFDanLu deleted the fix_strict_mode_storybook branch January 11, 2023 01:34
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