Skip to content

Commit 4e43f62

Browse files
committed
feat: use strict mode as default in storybook
1 parent 6708d80 commit 4e43f62

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = {
2020
addons: ['@storybook/addon-essentials', '@storybook/addon-a11y', '@storybook/addon-designs'],
2121
framework: {
2222
name: '@storybook/react-webpack5',
23-
options: {}
23+
options: { strictMode: true }
2424
},
2525
core: {
2626
disableWhatsNewNotifications: true

.storybook/preview.js

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ const withThemeProvider = (story, context) => {
7777
);
7878
};
7979

80-
const withStrictMode = (story, context) =>
81-
context.globals.strictMode === 'enabled' ? <StrictMode>{story()}</StrictMode> : <>{story()}</>;
80+
const withStrictMode = story => <StrictMode>{story()}</StrictMode>;
8281

8382
export const decorators = [withThemeProvider, withStrictMode];
8483

@@ -118,19 +117,5 @@ export const globalTypes = {
118117
{ value: 'fuschia', title: 'Custom primary hue' }
119118
]
120119
}
121-
},
122-
...(process.env.NODE_ENV === 'development' && {
123-
strictMode: {
124-
name: 'strictMode',
125-
description: 'Strict mode',
126-
defaultValue: 'disabled',
127-
toolbar: {
128-
icon: 'alert',
129-
items: [
130-
{ value: 'disabled', title: 'Strict mode disabled' },
131-
{ value: 'enabled', title: 'Strict mode enabled' }
132-
]
133-
}
134-
}
135-
})
120+
}
136121
};

0 commit comments

Comments
 (0)