hwookim / storybook-addon-cookie

Set document.cookie for each Storybook.
MIT License
9 stars 3 forks source link

Type Error: when I write the code as described in the README, it results in a type error #6

Closed ari1357 closed 1 year ago

ari1357 commented 1 year ago

Describe the Type Error


When I write the code in TypeScript as described in the README, I encounter errors due to type mismatches in decorators.

To Reproduce


storybook: v7.4.0 storybook-addon-cookie: 3.0.1

スクリーンショット 2023-09-09 17 37 28

What I would like to request


please make it so that type errors do not occur !

Other


The current state is that it works fine with just type errors, so the priority is not very high, I believe! Also, it was very helpful as there aren't many similar addons available. Thank you !!

Adding cookieDecorator to the decorators in preview.ts prevents errors from occurring, so I'm currently configuring it this way😏

.storybook/preview.ts スクリーンショット 2023-09-09 18 11 19(大)

hwookim commented 1 year ago

@ari1357 Oh, I'm sorry!

This is an error in the description in the README. There is already a definition for preview.decorators in the package, so you don't need to add any additional settings. In fact, it's not even possible to apply the addon to a specific story because of the panel settings. 😢

I've fixed the README, thanks for reporting the issue. 😄