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
Hello,
We are using storybook with Typescript. When trying to upgrade to v8.0.10, we encountered a type issue when we want to suppress the automatic summary generated for Controls. Previously, we would make it null like so:
With the change introduced at commit 3f7e1c2b84324ca24bc5bc968a6ab3245b11b757, null is no longer allowed. So we tried to use undefined instead. But since we use the stricter exactOptionalPropertyTypes: true configuration in our tsconfig.json, TypeScript raises the following error:
Type '{ summary: undefined; }' is not assignable to type '{ summary?: string; detail?: string; }' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'summary' are incompatible.
Type 'undefined' is not assignable to type 'string'.(2375)
Could you please change the type of summary to summary?: string | undefined so that we can keep our strict settings as well as disable the summary in controls ?
Describe the bug
Hello,
We are using storybook with Typescript. When trying to upgrade to v8.0.10, we encountered a type issue when we want to suppress the automatic
summary
generated for Controls. Previously, we would make itnull
like so:With the change introduced at commit 3f7e1c2b84324ca24bc5bc968a6ab3245b11b757,
null
is no longer allowed. So we tried to useundefined
instead. But since we use the stricterexactOptionalPropertyTypes: true
configuration in ourtsconfig.json
, TypeScript raises the following error:Could you please change the type of
summary
tosummary?: string | undefined
so that we can keep our strict settings as well as disable the summary in controls ?To Reproduce
Here is a link to reproduce: https://stackblitz.com/edit/github-wuwtca-dcgxst?file=src%2Fstories%2FButton.stories.ts
TypeScript raises an error in
src/stories/Button.stories.ts
, inargTypes
property ofmeta
.System
Additional context
No response
The text was updated successfully, but these errors were encountered: