Skip to content

Commit

Permalink
Merge pull request #24 from baselbj/master
Browse files Browse the repository at this point in the history
Force slider to rerender on props.value change
  • Loading branch information
Aswin authored Oct 30, 2020
2 parents 3434f22 + fa014b8 commit 1e4240c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ export default class VerticalSlider extends React.Component<props, state> {
this._changeState(value);
}
}

shouldComponentUpdate(nextProps: props, nextState: state){
if(nextProps.value && nextProps.value != nextState.value ){
this._changeState(nextProps.value);
}
return false
}

render() {
const {
Expand Down

0 comments on commit 1e4240c

Please sign in to comment.