diff --git a/addons/centered/src/react.tsx b/addons/centered/src/react.tsx index f914f3120c7b..a99c60a47e36 100644 --- a/addons/centered/src/react.tsx +++ b/addons/centered/src/react.tsx @@ -5,6 +5,17 @@ import parameters from './parameters'; import styles from './styles'; function centered(storyFn: () => ReactNode) { + /* eslint-disable no-undef */ + if (window) { + const params = new URL(window.location.href).search; + const isInDocsView = params.includes('viewMode=docs'); + + if (isInDocsView) { + return storyFn(); + } + } + /* eslint-enable no-undef */ + return (
{storyFn()}