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

ModalSelector - useState Modification #184

Open
k1nnx opened this issue Apr 1, 2023 · 0 comments
Open

ModalSelector - useState Modification #184

k1nnx opened this issue Apr 1, 2023 · 0 comments

Comments

@k1nnx
Copy link

k1nnx commented Apr 1, 2023

Problem

Using

  • Expo
  • React Native

Hello, whenever i am trying to call my setCurrentLabel function inside of the onChange function it does not update the label inside of the selector.

Code

image

Expected output:

The label changes in the modal, and the state gets updated.

Actual output:

The label does not change, therefore the useState cannot update because option is not updated.

This problem only arises when attempting to use a useState method.

I can confirm this is an issue with useState as setting the value manually using traditional javascript methods works just fine.

Working Code

image

Please don't hesitate to ask for more information regarding my use case, and source code.

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

1 participant