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
fix: missing index on LabelProps type #3939
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -54,15 +54,15 @@ export function LabelList<T extends Data>({ valueAccessor = defaultAccessor, ... | |||
|
|||
return ( | |||
<Label | |||
{...(filterProps(entry, true) as any)} | |||
{...filterProps(entry, true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
nikolasrieble
approved these changes
Nov 7, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean! 🚀
Actually wild that the cast at the top caused no errors for the rest of the properties underneath |
GMer78
pushed a commit
to GMer78/recharts-1
that referenced
this pull request
Nov 24, 2023
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> `index` is a valid property on `Label` although it is only used to reference which label is which in a `LabelList` ## Related Issue <!--- This project only accepts pull requests related to open issues --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please link to the issue here: --> recharts#3938 ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> - Removes a cast to `any` - Narrows type of `LabelList` correctly (anything that wasn't a property that could be used on `SVGTextElement` wasn't being used properly anyways. If this change breaks people they can mitigate by removing incorrectly used properties. ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> - Tests continue to pass - Imported type contains `index` property - ## Screenshots (if appropriate): N/A ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [X] 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: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [X] 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. - [ ] I have added a storybook story or extended an existing story to show my changes - [X] All new and existing tests passed. Co-authored-by: Coltin Kifer <ckifer@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
index
is a valid property onLabel
although it is only used to reference which label is which in aLabelList
Related Issue
#3938
Motivation and Context
any
LabelList
correctly (anything that wasn't a property that could be used onSVGTextElement
wasn't being used properly anyways. If this change breaks people they can mitigate by removing incorrectly used properties.How Has This Been Tested?
index
propertyScreenshots (if appropriate):
N/A
Types of changes
Checklist: