Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off Emotion's warnings about potentially unsafe pseudo-selectors in SSR #18361

Merged
merged 2 commits into from May 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 20 additions & 10 deletions lib/ui/src/index.tsx
Expand Up @@ -7,13 +7,21 @@ import ReactDOM from 'react-dom';

import { Location, LocationProvider, useNavigate } from '@storybook/router';
import { Provider as ManagerProvider, Combo } from '@storybook/api';
import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming';
import {
ThemeProvider,
ensure as ensureTheme,
CacheProvider,
createCache,
} from '@storybook/theming';
import { HelmetProvider } from 'react-helmet-async';

import App from './app';

import Provider from './provider';

const emotionCache = createCache({ key: 'sto' });
emotionCache.compat = true;

const { DOCS_MODE } = global;

// @ts-ignore
Expand Down Expand Up @@ -66,15 +74,17 @@ const Main: FC<{ provider: Provider }> = ({ provider }) => {
: !state.storiesFailed && !state.storiesConfigured;

return (
<ThemeProvider key="theme.provider" theme={ensureTheme(state.theme)}>
<App
key="app"
viewMode={state.viewMode}
layout={isLoading ? { ...state.layout, showPanel: false } : state.layout}
panelCount={panelCount}
docsOnly={story && story.parameters && story.parameters.docsOnly}
/>
</ThemeProvider>
<CacheProvider value={emotionCache}>
<ThemeProvider key="theme.provider" theme={ensureTheme(state.theme)}>
<App
key="app"
viewMode={state.viewMode}
layout={isLoading ? { ...state.layout, showPanel: false } : state.layout}
panelCount={panelCount}
docsOnly={story && story.parameters && story.parameters.docsOnly}
/>
</ThemeProvider>
</CacheProvider>
);
}}
</ManagerProvider>
Expand Down