Open k1nnx opened 1 year ago
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.
setCurrentLabel
onChange
The label changes in the modal, and the state gets updated.
The label does not change, therefore the useState cannot update because option is not updated.
option
This problem only arises when attempting to use a useState method.
useState
I can confirm this is an issue with useState as setting the value manually using traditional javascript methods works just fine.
Please don't hesitate to ask for more information regarding my use case, and source code.
Problem
Using
Hello, whenever i am trying to call my
setCurrentLabel
function inside of theonChange
function it does not update the label inside of the selector.Code
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
Please don't hesitate to ask for more information regarding my use case, and source code.