Open koumura-a-tm opened 1 year ago
For 7.0? onwards, need to invoke decorator as a workaround.
// preview.tsx - example
import type { Preview } from '@storybook/react'
...
const preview: Preview = {
loaders: [
...
],
decorators: [
(Story) => {
...
},
withScreenshot(), // <== invoke
],
parameters: {
...
},
}
export default preview
seems to be deprecated though?
Thank you for the answer from one perspective. But that won't be the solution.
Isn't it written in the official documentation as below? 「Using withScreenshot as function is deprecated. 」 reference: https://github.com/reg-viz/storycap#withscreenshot
Because it should look like this:
// deprecated
decorators: [withScreenshot()],
And I do it like this. However, I would like to avoid using any as much as possible.
// Solved with any
decorators: [withScreenshot as any],
@storybook/react 7.3.2 withScreenshot in preview.tsx I get an error.
storycap is still not compatible with storybook v7?