Skip to content

Commit cb6585c

Browse files
authored
feat(storybook/preview): Add StrictMode around stories (#636)
1 parent 513986d commit cb6585c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.storybook/preview.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Preview } from '@storybook/react-vite';
22
import { useDarkMode } from '@vueless/storybook-dark-mode';
33
import { useTheme } from 'next-themes';
4-
import { useEffect } from 'react';
4+
import { StrictMode, useEffect } from 'react';
55
import { ReactNode } from 'react';
66
import { useTranslation } from 'react-i18next';
77
import { StoryContext } from 'storybook/internal/csf';
@@ -86,12 +86,14 @@ const preview: Preview = {
8686
const isDarkMode = useDarkMode();
8787
return (
8888
<Providers>
89-
<DocumentationWrapper isDarkMode={isDarkMode} context={context}>
90-
{/* Calling as a function to avoid errors. Learn more at:
91-
* https://github.com/storybookjs/storybook/issues/15223#issuecomment-1092837912
92-
*/}
93-
{story(context)}
94-
</DocumentationWrapper>
89+
<StrictMode>
90+
<DocumentationWrapper isDarkMode={isDarkMode} context={context}>
91+
{/* Calling as a function to avoid errors. Learn more at:
92+
* https://github.com/storybookjs/storybook/issues/15223#issuecomment-1092837912
93+
*/}
94+
{story(context)}
95+
</DocumentationWrapper>
96+
</StrictMode>
9597
</Providers>
9698
);
9799
},

0 commit comments

Comments
 (0)