This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
fix: 🐛 Fixed type definition for chart plugin #123
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
This PR is to fix the type definiton for transformProps and LoadData.
Change the output of preTransformProps to ChartProps
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 76 76
Lines 965 970 +5
Branches 232 232
=====================================
+ Hits 965 970 +5
Continue to review full report at Codecov.
|
conglei
commented
Mar 25, 2019
export type PreTransformProps = TransformFunction<ChartProps>; | ||
export type TransformProps = TransformFunction; | ||
export type PreTransformProps = TransformFunction<ChartProps, ChartProps>; | ||
export type TransformProps = TransformFunction<ChartProps>; |
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.
I tried to do like
export type PreTransformProps = TransformFunction<ChartProps, ChartProps | PlainProps>;
export type TransformProps = TransformFunction<ChartProps | PlainProps>;`
However, in the chart plugin repo, if I define TransfromProps
as
export default function transformProps(chartProps: ChartProps)
it will show the error: Type 'PlainProps | ChartProps' is not assignable to type 'ChartProps'.
Fixed the test according to the changes:
kristw
changed the title
fix: 🐛 Fixed typ definiton for chart plugin
fix: 🐛 Fixed type definition for chart plugin
Mar 25, 2019
kristw
approved these changes
Mar 25, 2019
🎉 Thanks for fixing this. 💪 Noticed the same thing yesterday. Beat me to the fix. 🙂 |
kristw
pushed a commit
that referenced
this pull request
Apr 17, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR is to fix the type definiton for
transformProps
andLoadData
.For
TransformProps
, the input type should beChartProps
instead ofPlainObject
.For
LoadData
, before, theChartType
wasComponentType | FunctionComponent
, which means the no props allowed for the component, which is not correct.💔 Breaking Changes
🏆 Enhancements
Exported Metric definition.
📜 Documentation
🐛 Bug Fix
In most of the cases, There will be no
PreTransformProps
defined. Thus, the input for `TransformProp🏠 Internal