Storybook: addon-info: is `withInfo` decorator deprecated?

Created on 20 Dec 2019  路  4Comments  路  Source: storybookjs/storybook

Describe the bug
Sorry this is just a question.
addon-info's withInfo() decorator is deprecated?

To Reproduce
When I write a story like this,

import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withInfo } from '@storybook/addon-info';

import Button from './Button';

storiesOf('Button', module)
  .add('Default', withInfo('Default button')(() => (
    <Button label="The Button" onClick={action('click')} />
  )));

I get the following warning in the browser's console.

Passing stories directly into withInfo() is deprecated,
          instead use addDecorator(withInfo) and pass options with the 'info' parameter

What I want to know
I found that Storybook 4 had introduced story parameters.
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-story-parameters
But addon-info wasn't listed here.

So I want to ask you 3 questions:

  1. Is it correct that withInfo() is also deprecated, and I shouldn't use it any more?
  2. Do you have any plans about from which version I can't use this decorator style?
  3. Are there any codemods? I found update-addon-info.js, but it just replaces old addWithInfo() API
info question / support

Most helpful comment

Addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

All 4 comments

Addon-info is being superceded by addon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf

@shilman
Thank you! I'll try the new addon-docs.
What about my questions? Is withInfo() also deprecated like other addons' withXXX methods, right?

@zaki-yama It looks like it's deprecated and better to use parameters: { info: ... }} instead. But still supported (for now)!

@shilman
I understood! Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Olian04 picture Olian04  路  78Comments

enagy27 picture enagy27  路  69Comments

maraisr picture maraisr  路  119Comments

joeruello picture joeruello  路  79Comments

43081j picture 43081j  路  61Comments