Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Tag): fix state not matching props #614

Merged
merged 2 commits into from
Apr 28, 2019

Conversation

jdkahn
Copy link
Contributor

@jdkahn jdkahn commented Apr 28, 2019

  • derive checked state from props

- derive checked state from props
@jdkahn jdkahn requested a review from youluna April 28, 2019 04:26
@codecov
Copy link

codecov bot commented Apr 28, 2019

Codecov Report

Merging #614 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #614      +/-   ##
==========================================
+ Coverage   91.21%   91.21%   +<.01%     
==========================================
  Files         244      244              
  Lines       13889    13893       +4     
  Branches     4336     4337       +1     
==========================================
+ Hits        12669    12673       +4     
  Misses       1201     1201              
  Partials       19       19
Impacted Files Coverage Δ
src/tag/selectable.jsx 100% <100%> (ø) ⬆️

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 1cba940...40f96f0. Read the comment docs.

@@ -51,6 +51,16 @@ class Selectable extends Component {
bindCtx(this, ['handleClick']);
}

static getDerivedStateFromProps(props, state) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to import react-lifecycles-compat to make sure it can work on React v16.0-16.2
please run :
npm install --save react-lifecycles-compat

// add
import { polyfill } from 'react-lifecycles-compat';

class Selectable extends Component {
   ...
}
// add
polyfill(Selectable);

export default Selectable;

@jdkahn jdkahn requested a review from youluna April 28, 2019 08:43
@jdkahn jdkahn merged commit 52d09dd into alibaba-fusion:master Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants