storybook-addon icon indicating copy to clipboard operation
storybook-addon copied to clipboard

Theming option tab not showing

Open RHeynsZa opened this issue 3 years ago • 4 comments

Was the theming option removed recently? Im having the same issue as https://github.com/react-theming/storybook-addon/issues/28

My setup looks like this:

import { createTheme, ThemeProvider } from '@material-ui/core';
import { withThemes  } from '@react-theming/storybook-addon';
import themes from '../src/themes';

import { red } from '@material-ui/core/colors';

export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
};


// A custom theme for this app
const theme = {
  palette: {
    primary: {
      main: '#556cd6',
    },
    secondary: {
      main: '#19857b',
    },
    error: {
      main: red.A400,
    },
    background: {
      default: '#fff',
    },
  },
};

const providerFn = ({ theme, children }) => {
  const muiTheme = createTheme(theme);
  return (
    <ThemeProvider theme={muiTheme}>{children}</ThemeProvider>
  );
};

const themingDecorator = withThemes(null, [ themes.new, theme ], { providerFn });

export const decorators = [
  themingDecorator,
];

RHeynsZa avatar Jun 02 '22 14:06 RHeynsZa

Hey @RHeynsZa Could you please clarify what exactly is missing in your storybook? Did you specify this addon in main.js -> addons section?

usulpro avatar Jun 13 '22 06:06 usulpro

Seeing the same issue, where the theme option just doesn't show on the control panel. Strange because it was working before; no idea what changed.

Screen Shot 2022-06-17 at 9 41 02 AM

morleytatro avatar Jun 17 '22 16:06 morleytatro

Really weird. After disabling all other addons but this one and then progressively bringing them back, everything's working again.

morleytatro avatar Jun 17 '22 16:06 morleytatro

It loooks like this issue appears with React 18 At least I fased this after updating React major version

usulpro avatar Jun 21 '22 11:06 usulpro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 19 '22 13:10 stale[bot]