You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Preact library that we are documenting with Storybook inevitably includes hooks (and utility functions) that we would want to document together with our components.
The problem in documenting these functions (hooks, utility functions) is that while the properties of the hook (the argument of the hook function) could be documented by simply using a CSF story file with a default story (creating a wrapper component around the hook and exposing the hook function arguments as props on this wrapper component) and then connecting this to an MDX file (and just use ArgTypes or other DocBlocks)) documenting the return type seems to be more challenging.
What would be a reasonable approach on incorporating the return type into my storybook documentation without just manually writing documentation for them?
I'm looking for a way that would leverage existing components in Storybook so that when I manually update the hook source, the documentation would just be there?
We are using Preact, SB 8.3.6 and Vite as the builder.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Our Preact library that we are documenting with Storybook inevitably includes hooks (and utility functions) that we would want to document together with our components.
The problem in documenting these functions (hooks, utility functions) is that while the properties of the hook (the argument of the hook function) could be documented by simply using a CSF story file with a default story (creating a wrapper component around the hook and exposing the hook function arguments as props on this wrapper component) and then connecting this to an MDX file (and just use ArgTypes or other DocBlocks)) documenting the return type seems to be more challenging.
What would be a reasonable approach on incorporating the return type into my storybook documentation without just manually writing documentation for them?
I'm looking for a way that would leverage existing components in Storybook so that when I manually update the hook source, the documentation would just be there?
We are using Preact, SB 8.3.6 and Vite as the builder.
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions