Storybook: Is there a contract for docs?

Created on 29 Jul 2020  路  6Comments  路  Source: storybookjs/storybook

I'm using storybook with React and PureScript (a compile to JS language). It works very nicely, and now I tried to turn on "docs" which also works, but -as expected - I always get: "No props found for this component".
I know that docs page is supposed to be 0 config, but I'd really like to be able to manually pass the necessary info to the addon (via parameters on the default export?).
The same goes for "No code available".

I have looked for an answer to this for quite a while now but couldn't really find anything except how to change them, not plain add them.

I'll be very grateful for pointers on this.

docs question / support

All 6 comments

Try upgrading to 6.0 RC:

npx sb@next upgrade --prerelease

Then check this out:

https://github.com/storybookjs/storybook/blob/next/addons/controls/README.md#my-controls-arent-being-auto-generated-what-should-i-do

By the way, I'm very impressed with your work here @shilman ! Incredible work ethic on answering issues, I love the RFC approach, and the docs. Obviously love the product, too!

Worked like a charm. ~I'm just missing No code available now.~

Edit: I do see the Code now, but it's (not surprisingly) JSX and I'd rather have nothing or PureScript code as the example.

Hey @i-am-the-slime I think currently the addon docs is presenting a code snippet based on v-dom, which indeed will be JSX, but I believe soon you'll have the option to see the original source. If you want to check the exact code written for your stories, try checking storyshots for now, although it's not compatible with docs, so you will be seeing the source from the addon panel in canvas instead of docs.

Arlight, cool, thanks for answering so quickly! I'll close this for now then!

You can set docs.source.type parameter to 'code' to force the original source

Was this page helpful?
0 / 5 - 0 ratings

Related issues

levithomason picture levithomason  路  3Comments

tirli picture tirli  路  3Comments

miljan-aleksic picture miljan-aleksic  路  3Comments

sakulstra picture sakulstra  路  3Comments

Jonovono picture Jonovono  路  3Comments