I created a widget component with a single text field.
I added a
chkValue
variable of typebool
to the app's state.In the parent component, I placed the widget component (child) alongside a button.
The child component's text field uses the
onChange
action to update the button's color in the parent:If the text field is not empty, the button turns blue.
If the text field is empty, the button turns white.
However, with this setup, when onChange
is triggered, there is a delay of about 2 seconds before the button color changes.
When I implemented the same functionality directly in the parent component (placing the text field and button there), the color change happened instantly with no delay.
Is there a way to handle this scenario in the child component setup so that the button updates immediately without any delay?