#Replacement for `StoryFn`/`StoryContext` in custom decorator for addon

2 messages · Page 1 of 1 (latest)

rain wedge
#

Hello!

I'm a collaborator for Chakra UI currently taking on the task of migrating @chakra-ui/storybook-addon, and have a question regarding the migration of type signatures.

We've had a custom decorator to house Chakra's provider and the logic for syncing color mode. The function used as the decorator has this parameter set:

export function ChakraProviderDecorator( Story: StoryFn<any>, context: StoryContext )

The type signatures used originally came from @storybook/addons but look to have been removed. Are there new alternatives here from the manager-api or preview-api or do they have to be imported from @storybook/react-webpack5?

low seal
#

Hi! You should be able to import { DecoratorFn } from '@storybook/react' and type the full function.