Props / Story panels don't load
leonardofaria opened this issue · 10 comments
Hi
I am trying to use your addon and I am not sure what I'm missing here. I tried different setups without success. Here is what I get so far:
addons.js
import '@storybook/addons'
import '@storybook/addon-options/register'
import '@storybook/addon-actions/register'
import '@storybook/addon-knobs/register'
import 'storybook-addon-props/register'
config.js
import { configure, setAddon } from '@storybook/react'
import infoAddon from '@storybook/addon-info'
import addWithDoc from 'storybook-addon-props'
import centered from '@storybook/addon-centered'
import { setOptions } from '@storybook/addon-options'
const req = require.context('../components', true, /\.stories\.js$/)
setAddon(infoAddon)
setAddon(addWithDoc)
setAddon({
addCentered(storyName, storyFn) {
this.add(storyName, (context) => (
centered.call(context, storyFn)
))
},
})
// All options: https://git.io/vHpmO
setOptions({
name: 'XX',
url: '/',
})
function loadStories() {
req.keys().forEach((filename) => req(filename))
}
window.STORYBOOK_REACT_CLASSES = {}
configure(loadStories, module)
story.js
import React from 'react'
import { storiesOf } from '@storybook/react'
import { withKnobs, text, boolean, select } from '@storybook/addon-knobs'
import { action } from '@storybook/addon-actions'
import centered from '@storybook/addon-centered'
import Button from './Button'
const stories = storiesOf('Button', module)
stories.addDecorator(withKnobs).addDecorator(centered)
stories.addWithDoc(
'default',
Button,
'Description',
() => {
const classNames = {
'btn-default': 'btn-default',
'btn-primary': 'btn-primary',
'btn-secondary': 'btn-secondary',
'btn-info': 'btn-info',
'btn-success': 'btn-success',
'btn-error': 'btn-error',
}
return (
<Button
href={text('href', null)}
onClick={action('toggle')}
disabled={boolean('disabled', false)}
className={select('className', classNames)}
>
{text('children', 'Hello Stranger')}
</Button>
)
},
)
I am also using babel-plugin-react-docgen
, which loads the component props definitions fine in the stories that use storybook-addon-info.
Do you know about some conflict between storybook-addon-props and the other ones? The only panels that I see are "Action Logger" and "Knobs".
Hi Leonardo
I'm not aware of any conflict between addon-props and other addons, but I never tried to include so many of them like you do.
My advice is to try to disable all, and then add one by one to see where the problem happens.
At least you can start by removing references to addon-info which is no longer required if you want to use addon-props.
I tried that and I also pinged storybook slack channel.
One question came from there: is this addon compatible with storybook 3?
Yes, I made an update 10 days ago (v3.0.2) to support storybook 3.
Hello, I have exactly the same problem, no Props and Story panels. Any update about that problem?
I am not sure @przybyla
Any tip in debugging this issue @marc-rutkowski?
@leonardofaria @przybyla I'm sorry but I cannot reproduce the problem and I don't have any time right now to work on this, but maybe this weekend. In the meantime if you can setup a sample repo that demonstrate problem it can be helpful.
Thanks @marc-rutkowski I will setup a sample repo and I let you know.
Could you please do the same @przybyla?
Some way I can help?
Are you registering the addon?
Is there a working example somewhere we can take a look at @marc-rutkowski ?
Hi @ndelangen,
Thanks for your help.
I'm sorry but I have no time to work on this anymore.
Maybe @przybyla and @leonardofaria have some updates or can provide a sample repo?
There is an example
and a .storybook
directory into the source code if that can help.
I'll probably set this project as deprecated in a near future when this PR and this one will land.
I am down for making this project as deprecated since there are new PRs into the storybook.