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

[xychart/annotation] Fix LineSubject types and strokeWidth #991

Merged
merged 4 commits into from
Jan 11, 2021

Conversation

Janpot
Copy link
Contributor

@Janpot Janpot commented Jan 5, 2021

🐛 Bug Fix

It was impossible to set strokeWidth on LineSubjects because the property was never passed through. I also augmented the types with the svg line properties because I was getting type errors when trying to set strokeDasharray

@coveralls
Copy link

coveralls commented Jan 5, 2021

Pull Request Test Coverage Report for Build 475866565

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 61.189%

Totals Coverage Status
Change from base Build 462020185: 0.01%
Covered Lines: 1728
Relevant Lines: 2690

💛 - Coveralls

Copy link
Collaborator

@williaster williaster left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @Janpot. The strokeWidth fix definitely makes sense but I had one question about the type change.

...restProps
}: LineSubjectProps & Omit<React.SVGProps<SVGLineElement>, keyof LineSubjectProps>) {
}: LineSubjectProps) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you send a link that reproduced the TS error you are seeing? It works okay for me in the /annotation codesandbox

image

For other packages/components we have preferred to set the native SVG props on the component as a union with its own exported prop types, rather than on the exported prop types themselves to keep them separate and simplify re-use of the export where relevant.

Copy link
Contributor Author

@Janpot Janpot Jan 6, 2021

Choose a reason for hiding this comment

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

Screenshot 2021-01-06 at 22 09 27

I actually saw it on AnnotationLineSubject.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@williaster Update the PR to update AnnotationLineSubject instead

Copy link
Collaborator

@williaster williaster left a comment

Choose a reason for hiding this comment

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

Awesome, thanks @Janpot ! LGTM. Will get this out in 1.4.0 hopefully later today.

@williaster williaster merged commit bb4431e into airbnb:master Jan 11, 2021
@williaster williaster added this to the 1.4.0 milestone Jan 11, 2021
@williaster williaster changed the title [annotation] Fix LineSubject types and strokeWidth [xychart/annotation] Fix LineSubject types and strokeWidth Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants