Skip to content
New issue

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

add arg table for ReferenceArea stories #3486

Conversation

lukask-proxora
Copy link
Contributor

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

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
Member

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

@ckifer
Copy link
Member

ckifer commented Mar 31, 2023

+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
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
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.

Copy link
Contributor

@nikolasrieble nikolasrieble left a comment

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
Copy link
Member

ckifer commented Apr 7, 2023

merging in for now, thanks!

@ckifer ckifer merged commit cb69aa7 into recharts:master Apr 7, 2023
5 checks passed
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.

None yet

4 participants