cangoektas / react-on-off

Flexible React components to manage on/off states
MIT License
22 stars 0 forks source link

Fix control-prop bugs #13

Closed cangoektas closed 6 years ago

cangoektas commented 6 years ago

There's a bug in the current implementation when using the control prop. The on prop doesn't take precedence over internal state changes. Also, copying prop changes with getDerivedStateFromProps is not necessary.

codecov-io commented 6 years ago

Codecov Report

Merging #13 into next will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@         Coverage Diff         @@
##           next    #13   +/-   ##
===================================
  Coverage   100%   100%           
===================================
  Files         6      6           
  Lines        50     56    +6     
  Branches     10     14    +4     
===================================
+ Hits         50     56    +6
Impacted Files Coverage Δ
src/OnOff.js 100% <100%> (ø) :arrow_up:
src/OnOffItem.js 100% <100%> (ø) :arrow_up:
src/OnOffCollection.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 838e363...49cc3f6. Read the comment docs.