You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apart from useArgs not working due to Storybook channel limitations (#29773), other hooks from @storybook/preview-api also don't behave as expected, such as useState and useEffect.
💡 Solutions/Action items:
Research on how feasible it is to implement support for this
Document this limitation
Currently, portable stories are not compatible with Storybook hooks from @storybook/preview-api. This makes it hard for users who have stories like so to use the Storybook Test feature:
import{useArgs}from'@storybook/preview-api'exportconstDefault={args: {value: true,},render: functionRender(){const[{ value },updateArgs]=useArgs()constonValueChange=()=>updateArgs({value: !value})return<buttononClick={onValueChange}>The value is {JSON.stringify(value)}</button>},play: async({ canvas })=>{constbutton=awaitcanvas.findByText('The value is true')awaitexpect(button).toBeInTheDocument()awaituserEvent.click(button)awaitexpect(awaitcanvas.findByText('The value is false')).toBeInTheDocument()}}
The text was updated successfully, but these errors were encountered:
Apart from
useArgs
not working due to Storybook channel limitations (#29773), other hooks from@storybook/preview-api
also don't behave as expected, such asuseState
anduseEffect
.💡 Solutions/Action items:
Currently, portable stories are not compatible with Storybook hooks from
@storybook/preview-api
. This makes it hard for users who have stories like so to use the Storybook Test feature:The text was updated successfully, but these errors were encountered: