Closed mathbalduino closed 1 year ago
Merging #810 (2a51745) into main (8dde349) will not change coverage. The diff coverage is
n/a
.:exclamation: Current head 2a51745 differs from pull request most recent head 0e75b8b. Consider uploading reports for the commit 0e75b8b to get more accurate results
@@ Coverage Diff @@
## main #810 +/- ##
=======================================
Coverage 98.71% 98.71%
=======================================
Files 525 525
Lines 4450 4450
Branches 686 686
=======================================
Hits 4393 4393
Misses 57 57
Files Changed | Coverage Δ | |
---|---|---|
...rc/components/Select/SelectSingle/SelectSingle.tsx | 100.00% <ø> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Hey,
I was trying to build a custom
<SelectAsync />
using theonClear
andonIconClick
props, but I noticed some strange behavior: When I passed any of them, to<SelectAsync />
, the component misbehavedLooking into the code, to see what happened, I noticed the following lines of code: /src/components/Select/SelectSingle/SelectSingle.tsx:110
If you look closely, you'll see that the lines 112 and 113 are composing both
onIconClick
andonClear
props, directly from theprops
object, without destructing them from it. At line 115, we can see that we are overriding everything with what we have on therest
object, that still contains bothonIconClick
andonClear
.So, if you set them, the lines 112 and 113 will be ignored. This PR will just extract both props from the
props
object, so that therest
object doesn't override them