Skip to content

Commit

Permalink
build(Storybook): Disable React.StrictMode behind env var flag
Browse files Browse the repository at this point in the history
Disabling by default for now because `focus-trap-react` is throwing StrictMode errors:

focus-trap/focus-trap-react#77

Also worth nothing that currently StrictMode does not work in the Docs tab (only Canvas):

storybookjs/storybook#17880
  • Loading branch information
m7kvqbe1 committed Apr 27, 2022
1 parent b63c57c commit e55d756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 3 additions & 0 deletions packages/react-component-library/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ module.exports = {
${process.env.NETLIFY ? newRelic.script : ''}
`,
stories: ['../src/**/*.stories.tsx'],
reactOptions: {
strictMode: process.env.REACT_STRICT_MODE === '1',
},
}
9 changes: 2 additions & 7 deletions packages/react-component-library/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ export const parameters = {
}

export const decorators = [
(Story) => (
<React.StrictMode>
<GlobalStyleProvider>
<Story />
</GlobalStyleProvider>
</React.StrictMode>
),
// https://github.com/storybookjs/storybook/issues/15223#issuecomment-1092837912
(Story) => <GlobalStyleProvider>{Story()}</GlobalStyleProvider>,
]

0 comments on commit e55d756

Please sign in to comment.