1 | # example addon: decorator
|
2 |
|
3 | This addon exposes a function users can use to wrap their storyFn with. This is called a decorator in storybook's terminology.
|
4 |
|
5 | A decorator can perform analysis on the storyFn, detect how long it takes to render, detect side-effects, and have access to the storyContext.
|
6 |
|
7 | It's also possible to wrap the results with some additional html/jsx or provide additional data to the storyFn.
|
8 |
|
9 | Uses include:
|
10 | - do side-effects detection
|
11 | - wrap story with additional html
|
12 | - add data to storyFn
|