Skip to content

add arg table for ReferenceArea stories#3486

Merged
ckifer merged 2 commits into
recharts:masterfrom
lukask-proxora:3432-storybook-reference-area-args-table
Apr 7, 2023
Merged

add arg table for ReferenceArea stories#3486
ckifer merged 2 commits into
recharts:masterfrom
lukask-proxora:3432-storybook-reference-area-args-table

Conversation

@lukask-proxora

@lukask-proxora lukask-proxora commented Mar 26, 2023

Copy link
Copy Markdown
Contributor

Description

Related Issue

#3432

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Screenshot from 2023-03-26 17-57-49
Screenshot from 2023-03-26 17-57-43
Screenshot from 2023-03-26 17-57-31
Screenshot from 2023-03-26 17-57-16
Screenshot from 2023-03-26 17-57-07
Screenshot from 2023-03-26 17-56-48

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Yilun-Sun

Copy link
Copy Markdown
Member

Hi @lukask-proxora! Please rebase to master to avoid CI failing on type errors. Thanks!

@ckifer

ckifer commented Mar 31, 2023

Copy link
Copy Markdown
Member

+1 to the above, thanks

@ckifer ckifer added the refactor PRs that refactor existing code label Mar 31, 2023
@@ -9,24 +9,37 @@ export const animationBegin = {
description: 'Specifies when the animation should begin, the unit of this option is ms.',
type: { name: 'number' },
defaultValue: 0,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the defaultValue seems to be defined twice. Is that necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nikolasrieble, without the defaultValue in the table prop, the default value in the args table is not set to the manually set defaultValue of the argType, but only to the inferred default value.

According to storybookjs/storybook#11983 (comment) (which also refers to https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#no-longer-inferring-default-values-of-args):

To affect the Default column in the ArgsTable, you should set the argTypes..table.defaultValue field. The value should be an object with the keys summary and optionally details, which are both strings.

@nikolasrieble nikolasrieble left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, please remove the redundant duplicate definition of the defaultValue in the AnimationProps. Not blocking though.

@ckifer

ckifer commented Apr 7, 2023

Copy link
Copy Markdown
Member

merging in for now, thanks!

@ckifer
ckifer merged commit cb69aa7 into recharts:master Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor PRs that refactor existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants