Open karanjhinga opened 3 years ago
@karanjhinga did you find a solution for this? Or did you edit this. @sacmii This is preventing this package to work.
Change return to true and the ball indicator will update. But you should check carefully about the performance of your app.
I changed shouldComponentUpdate
to the following, which will let the ball indicator update while also preserving performance:
shouldComponentUpdate(nextProps: props, nextState: state) {
let shouldUpdate = nextProps.value !== this.props.value || nextProps.value !== this.state.value;
if (shouldUpdate) {
this._changeState(nextProps.value);
}
return shouldUpdate;
}
Is the above solution of Jun 7, 2022 by BaderSerhan the preferred solution? If so, please could the repository be updated accordingly?
We are currently facing the same issue. any ideas?
There is the following fork of this repo that has the ball number updating:
https://www.npmjs.com/package/rn-vertical-slider-matyno?activeTab=explore
I'm using that fork for now.
The problem lies with the component should update
By making this u are preventing the component from rerendering