Skip to content

Commit

Permalink
Diff responds to value change (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
dht authored and securingsincity committed Jul 3, 2018
1 parent 1943315 commit 8115138
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export default class DiffComponent extends Component {
this.diff = this.diff.bind(this);
}

componentWillReceiveProps(props) {
const {value} = props;

if (value !== this.state.value) {
this.setState({value});
}
}

onChange(value) {
this.setState({
value: value
Expand Down

0 comments on commit 8115138

Please sign in to comment.