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

ball indicator not updating #26

Open
karanjhinga opened this issue Nov 17, 2020 · 6 comments
Open

ball indicator not updating #26

karanjhinga opened this issue Nov 17, 2020 · 6 comments

Comments

@karanjhinga
Copy link

The problem lies with the component should update

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

By making this u are preventing the component from rerendering

@JayantJoseph
Copy link

JayantJoseph commented Dec 11, 2020

@karanjhinga did you find a solution for this? Or did you edit this.
@sacmii This is preventing this package to work.

@tai8292
Copy link

tai8292 commented Apr 7, 2021

Change return to true and the ball indicator will update. But you should check carefully about the performance of your app.

@BaderSerhan
Copy link

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;
    }

@will-thrive
Copy link

Is the above solution of Jun 7, 2022 by BaderSerhan the preferred solution? If so, please could the repository be updated accordingly?

@tal-VSL
Copy link

tal-VSL commented Jan 26, 2023

We are currently facing the same issue. any ideas?

@will-thrive
Copy link

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.

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

No branches or pull requests

6 participants