This repository was archived by the owner on Mar 4, 2020. It is now read-only.
chore: simplify getUnhandledProps() & getElementType()#2003
Merged
layershifter merged 2 commits intomasterfrom Oct 3, 2019
Merged
chore: simplify getUnhandledProps() & getElementType()#2003layershifter merged 2 commits intomasterfrom
layershifter merged 2 commits intomasterfrom
Conversation
99f4793 to
7a52ca0
Compare
Codecov Report
@@ Coverage Diff @@
## master #2003 +/- ##
==========================================
+ Coverage 70.29% 77.01% +6.72%
==========================================
Files 894 158 -736
Lines 7863 5456 -2407
Branches 2304 1578 -726
==========================================
- Hits 5527 4202 -1325
+ Misses 2323 1241 -1082
Partials 13 13
Continue to review full report at Codecov.
|
7a52ca0 to
6af3aed
Compare
6af3aed to
153a6cd
Compare
Collaborator
Changed dependencies are detected.Changed dependencies in
Generated by 🚫 dangerJS |
layershifter
commented
Oct 3, 2019
| // ---------------------------------------- | ||
| // user defined "as" element type | ||
|
|
||
| if (props.as && props.as !== defaultProps.as) return props.as |
Member
Author
There was a problem hiding this comment.
After #1396 there is no sense in this condition.
We want to use props.as or div. In the case when props.as is not defined it will come from defaultProps.as, it's handled by React.
layershifter
commented
Oct 3, 2019
| ) | ||
|
|
||
| const unhandledProps = getUnhandledProps({ handledProps }, props) | ||
| const unhandledProps = getUnhandledProps(handledProps, props) |
Member
Author
There was a problem hiding this comment.
It was strange to pass handledProps in object when we can just pass them.
layershifter
commented
Oct 3, 2019
| } | ||
|
|
||
| static handledProps = _.keys(AutoFocusZone.propTypes) | ||
| static handledProps = _.keys(AutoFocusZone.propTypes) as any |
Member
Author
jurokapsiar
approved these changes
Oct 3, 2019
This file contains hidden or 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
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.

Based on findings from #1355.
This PR simplifies our
getUnhandledProps()andgetElementType()helper functions that makes them more reusable.I also moved them to
@stardust-ui/react-bindingsand improved types on them. Adds a missing UT forgetElementType().