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

state is not updating after onValueChange in Picker Component. #52

Open
ramanguptazelhus opened this issue Feb 28, 2024 · 3 comments
Open

Comments

@ramanguptazelhus
Copy link

  1. Please use the componentDidUpdate method for the updating the state.
  2. Why auto scroll up and scroll down onValueChange. @slauzinho @christheyounger @kaisv7n @omeryilmazel @cinnamonpon @TronNatthakorn
@matheusmazeto
Copy link

  1. Please use the componentDidUpdate method for the updating the state.

@ramanguptazelhus Did you fixed this issue in your codebase? If so, can you share how you did it?

@spasma
Copy link

spasma commented Mar 3, 2024

add this to the picker.js file within the class:

componentDidUpdate(prevProps) {
    if (prevProps.selectedValue !== this.props.selectedValue) {
      this.setState({ selectedValue: this.props.selectedValue });
    }
  }

PR created here: #54

@Hoshiiii2602
Copy link

Worked on my app

add this to the picker.js file within the class:

componentDidUpdate(prevProps) {
    if (prevProps.selectedValue !== this.props.selectedValue) {
      this.setState({ selectedValue: this.props.selectedValue });
    }
  }

PR created here: #54

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

4 participants