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:
withInfo() is also deprecated, and I shouldn't use it any more?addWithInfo() APIAddon-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.
Most helpful comment
Addon-infois being superceded byaddon-docs, which fixes a bunch of bugs and is easier to maintain. Please give it a try! https://medium.com/storybookjs/storybook-docspage-e185bc3622bf