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

Unclear docs? How do I install it? #83

Open
anatoliykmetyuk opened this issue Dec 15, 2023 · 8 comments
Open

Unclear docs? How do I install it? #83

anatoliykmetyuk opened this issue Dec 15, 2023 · 8 comments
Labels

Comments

@anatoliykmetyuk
Copy link

Installation instructions say:

Just import it in your storybook config.js:

What config.js? I looked it up in the docs, but nothing comes up. All the storybook config files I know are located in the .storybook folder: main.ts and preview.ts. I tried adding the addon to main.ts, "@storybook/addon-console", but with no result. Is that a case of an obsolete doc or am I missing something?

@vascoeduardo
Copy link

I have the same Problem. Any updates?

@adrianwix
Copy link

@alvis
Copy link

alvis commented Mar 10, 2024

The doc is certainly outdated and doesn't more harm than being helpful in today's settings.
Simply put, for v7 & v8, what we need is simply having this line

// .storybook/preview.tsx
import '@storybook/addon-console';

// rest of the preview configuration ...

@IanVS
Copy link
Member

IanVS commented Mar 11, 2024

Would anyone like to submit a PR?

@RubyHuntsman
Copy link

Any updates?

@ReiRev
Copy link

ReiRev commented Apr 6, 2024

For me, this worked. I changed preview.ts in .storybook

import type { Preview } from "@storybook/react";
import { withConsole } from "@storybook/addon-console";

const preview: Preview = {
  parameters: {
    controls: {
      matchers: {
        color: /(background|color)$/i,
        date: /Date$/i,
      },
    },
  },
  decorators: [(Story, context) => withConsole()(Story)(context)],
};

export default preview;

@gaomeng1900
Copy link

None of these work anymore for V8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants