From 5b9f090fa1cff335a1463cdede8200f9f490eebd Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Mon, 20 May 2024 14:46:15 +0100 Subject: [PATCH] Remove Strict Mode decorator from Storybook (#3439) --- .storybook/preview.tsx | 11 ----------- docs/decorators/withStrictMode.tsx | 16 ---------------- 2 files changed, 27 deletions(-) delete mode 100644 docs/decorators/withStrictMode.tsx diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index b6ac53ac53..161c287a46 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -20,7 +20,6 @@ import { ComponentProps } from "react"; import { withTheme } from "docs/decorators/withTheme"; import { withResponsiveWrapper } from "docs/decorators/withResponsiveWrapper"; import { WithTextSpacingWrapper } from "docs/decorators/withTextSpacingWrapper"; -import { withStrictMode } from "docs/decorators/withStrictMode"; import { withScaffold } from "docs/decorators/withScaffold"; import { withDateMock } from "docs/decorators/withDateMock"; import { SaltProvider } from "@salt-ds/core"; @@ -90,15 +89,6 @@ export const globalTypes: GlobalTypes = { items: ["disable", "enable"], }, }, - strictMode: { - name: "Strict Mode", - description: "Enables React's Strict Mode", - defaultValue: "enable", - toolbar: { - items: ["disable", "enable"], - title: "Strict Mode", - }, - }, scaffold: { name: "Scaffold", description: "Enables the testing scaffold", @@ -211,7 +201,6 @@ export const decorators = [ withResponsiveWrapper, withTheme, WithTextSpacingWrapper, - withStrictMode, withDateMock, ]; diff --git a/docs/decorators/withStrictMode.tsx b/docs/decorators/withStrictMode.tsx deleted file mode 100644 index 848b627d49..0000000000 --- a/docs/decorators/withStrictMode.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { Decorator } from "@storybook/react"; -import { StrictMode } from "react"; - -export const withStrictMode: Decorator = (Story, context) => { - const { strictMode } = context.globals; - - if (strictMode === "disable") { - return ; - } - - return ( - - - - ); -};