Hi, I just installed Storybook 7 using NextJs. I was using NextJs with Emotion on Storybook 6 and it worked perfectly. But it seems that I have a configuration problem because my style appears partially, let me explain:
I started by adding the global style with withThemeFromJSXProvider
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
import { Global } from '@emotion/react';
import globalShared from '../src/styles/globalShared';
const withGlobalStyle = () => (
<Global
styles={globalShared}
/>
);
export const decorators = [
withThemeFromJSXProvider({
GlobalStyles: withGlobalStyle,
}),
];
and it only shows the style present in my globalShared file:
import { css } from '@emotion/react';
return css`
* {
color: ${colors.error};
font-family: sans-serif;
}
button {
background-color: ${colors.success};
}
`;
// red and green are used for tests to show that this emotion style is present
I would like the emotion css of my components to be displayed
I have this error message in the console:
Invalid prop `theme` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.
Do you know why this message appears and how I can solve my problem to get my style as I had on Storybook 6?
*For images, the gray button is what I had, the green button is the problem