Repository navigation
fix(CheckBox): Added onValueChange prop in checkbox - #39
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #39 +/- ##
===========================================
- Coverage 100% 98.72% -1.28%
===========================================
Files 57 57
Lines 309 314 +5
Branches 30 32 +2
===========================================
+ Hits 309 310 +1
- Misses 0 4 +4
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #39 +/- ##
======================================
Coverage 100% 100%
======================================
Files 57 57
Lines 309 322 +13
Branches 30 35 +5
======================================
+ Hits 309 322 +13
Continue to review full report at Codecov.
|
| } | ||
|
|
||
| if (onValueChange) { | ||
| onValueChange(value, checked); |
There was a problem hiding this comment.
Is the new value sent forward correct? Or should it be !checked?
There was a problem hiding this comment.
It will pass the current value of the checkbox before alteration.
This is the behaviour followed by material ui
React Native paper only have an onPress which does not provide you any parameters and it actually expects you to alter the current state manually.
|
🎉 This PR is included in version 1.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Handled onValueChange with onPress callback
onPress will behave as a callback without any parameters but onValueChange will have value and checked parameters.