We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug I'd expect standard merging of objects to work.
Object.assign({foo: ''}, {foo: undefined}) // {foo: undefined}
To Reproduce
null
Expected behavior Both null and undefined should merge into args.
undefined
Screenshots If applicable, add screenshots to help explain your problem.
Code snippets
import { Meta, Story } from '@storybook/react/types-6-0'; import React from 'react'; import { Card, CardFooter, CardProps } from '.'; import { Avatar } from '../Avatar'; export default { title: 'Components/Content/Card', component: Card, subcomponents: { CardFooter, }, args: { tabIndex: 0, $variant: 'edgeToEdge', preview: ( <img src="sunset-delight.jpg" alt="Preview" style={{ objectFit: 'cover', width: '100%', height: `${2 / 3 * 100}%`, verticalAlign: 'top' }} /> ), eyebrow: 'Nature', head: 'The Life of Skies & Sunsets', body: 'Lorem ipsum dolor sit amet, vim te nominavi moderatius efficiantur. Inimicus reprimique consectetuer eu eos. Reque aliquam in per.', footer: ( <CardFooter cue={<Avatar $size="smallest" src="avatar.jpg" alt="Avatar" />} title="Betty Cooper" subtitle="Oct 31, 2020 • 3 min read" /> ), }, argTypes: { onClick: { action: 'onClick', }, $variant: { control: { type: 'select', options: ['edgeToEdge', 'offEdge', 'cardless'], }, }, }, } as Meta; const Template: Story<CardProps> = args => <Card {...args} />; export const Main = Template.bind({}); export const OffEdge = Template.bind({}); OffEdge.args = { $variant: 'offEdge', }; export const Cardless = Template.bind({}); Cardless.args = { $variant: 'cardless', }; export const Eyebrowless = Template.bind({}); Eyebrowless.args = { eyebrow: undefined, }; export const Bodyless = Template.bind({}); Bodyless.args = { body: undefined, }; export const CoreOnly = Template.bind({}); CoreOnly.args = { footer: undefined, }; export const HeadOnly = Template.bind({}); HeadOnly.args = { body: undefined, eyebrow: undefined, footer: undefined, }; export const Minimal = Template.bind({}); Minimal.args = { eyebrow: undefined, body: undefined, }; export const Avatarless = Template.bind({}); Avatarless.args = { footer: ( <CardFooter title="Betty Cooper" subtitle="Oct 31, 2020 • 3 min read" /> ), };
System Please paste the results of npx sb@next info here.
npx sb@next info
Additional context Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Combine args with basic object spread semantics
b697fe6
Fixes #12697
Son of a gun!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.0-alpha.33 containing PR #12958 that references this issue. Upgrade today to the @next NPM tag to try it out!
@next
npx sb upgrade --prerelease
Sorry, something went wrong.
tmeasday
Successfully merging a pull request may close this issue.
Describe the bug
I'd expect standard merging of objects to work.
To Reproduce
null
they DO merge.Expected behavior
Both
null
andundefined
should merge into args.Screenshots
If applicable, add screenshots to help explain your problem.
Code snippets
System
Please paste the results of
npx sb@next info
here.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: