Closed thevoiceless closed 2 years ago
Thanks for reporting this issue. I'll try reproducing this on Compose (with and without useCompose) as well as React to test the appropriate behaviour.
Tried the following cases
0
0
1
1
2
2
...
0
0
0
1
Interesting! Thanks for looking into it :)
Context: https://www.reddit.com/r/androiddev/comments/rqdv5g/there_are_three_ways_to_declare_a_mutablestate/
tl;dr:
will output
In light of that, perhaps useState should be updated? Something like: