Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
docs(stories): Add a note about using storyBook() with hooks and HoC …
Browse files Browse the repository at this point in the history
…wrappers (#1115)

* docs(stories): Add a note about using storyBook() with hooks and HoC wrappers

* Update src/docs/frontend/component-library.mdx

Co-authored-by: Malachi Willey <malwilley@gmail.com>

---------

Co-authored-by: Malachi Willey <malwilley@gmail.com>
  • Loading branch information
ryan953 and malwilley authored Dec 22, 2023
1 parent 4f95d44 commit 6628c28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/docs/frontend/component-library.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Some tips to remember:
- Don't be afraid to import anything else you need to help illustrate use cases for your component. It's useful to leverage `<p>` and `<Fragment>` in most cases for example.
- If you are demonstrating a component that relies on a global hook like `useOrganization()` or `usePageFilters()`, then you should wrap your story with those context providers manually.
- Named exports, or a mix of named and default exports, are all supported. This is more useful with [non-framework stories](#non-framework-stories).
- You can pass the component itself into `storyBook()` to get a nice title on the page. This avoids typos. But be careful of scenarios where a string should be used instead! For example, in a production build components that use `forwardRef` or HoC's can have minified names. Also hook names are always minified. Pass a string instead.

### Non-framework stories

Expand Down

1 comment on commit 6628c28

@vercel
Copy link

@vercel vercel bot commented on 6628c28 Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

develop – ./

develop.sentry.dev
develop-git-master.sentry.dev

Please sign in to comment.