You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
First of all, great library! But I faced strange issue and can't understand -- or this is a bug, or I just missed something. The problem is related to how useEffect works -- it seems like it doesn't trigger rebuild when state inside it changes.
In my example, I do input.value += '1' by pressing a button and I see 5 printed lines. But technically it should be 6, right?
Because in useEffect we change the state and it should retrigger build (otherwise useMemoized not updating)
Did I miss something? Because in React.js this example would work
To Reproduce
final input = useState('');
final confirm = useState('');
print('input: $input.value, confirm: $confirm.value');
final subtitleText = useMemoized(() {
return confirm.value.isEmpty ? 'Create New Passocde' : 'Confirm Passcode';
}, [confirm.value]);
useEffect(() {
if (input.value.length == 4) {
confirm.value = input.value;
}
return null;
}, [input.value]);
Expected behavior
I see 5 lines of printed text but it should be 6:
Describe the bug
First of all, great library! But I faced strange issue and can't understand -- or this is a bug, or I just missed something. The problem is related to how useEffect works -- it seems like it doesn't trigger rebuild when state inside it changes.
In my example, I do input.value += '1' by pressing a button and I see 5 printed lines. But technically it should be 6, right?
Because in useEffect we change the state and it should retrigger build (otherwise useMemoized not updating)
Did I miss something? Because in React.js this example would work
To Reproduce
Expected behavior
I see 5 lines of printed text but it should be 6:
The text was updated successfully, but these errors were encountered: