Problem
In certain logic "main loop" and "event action" access shared data via mutex.
Originally there was no problem, but as soon as I used the set of use_state the problem started. What is done writing in "main loop" is not visible in "event action".
If I removed use_statue.set, it worked as expected again.
The link below is my code where the problem occurred.
If you run it, it should be reproducible.
https://github.com/myyrakle/rustetris/blob/8e7e5389a5cfaa3113ee7606fc79090ad5822f5c/src/components/gamebox.rs#L24
Steps To Reproduce
Steps to reproduce the behavior:
- Execute the above code as it is.
- Press the start button and the tetris game will start.
- Press the left and right arrow keys to move.
- Uncomment the set function and run it again.
- It will not move even if you press the left and right arrow keys. (The error is due to the mutex sync failure issue mentioned above.)
Expected behavior
Screenshots

Environment:
- Yew version: 0.19
- Rust version: 1.64 stable
- Target, if relevant: wasm32-unknown-unknown
- Build tool, if relevant: trank
- OS, if relevant: windows 11
- Browser and version, if relevant: not relevant
Questionnaire
Problem
In certain logic "main loop" and "event action" access shared data via mutex.
Originally there was no problem, but as soon as I used the set of use_state the problem started. What is done writing in "main loop" is not visible in "event action".
If I removed use_statue.set, it worked as expected again.
The link below is my code where the problem occurred.
If you run it, it should be reproducible.
https://github.com/myyrakle/rustetris/blob/8e7e5389a5cfaa3113ee7606fc79090ad5822f5c/src/components/gamebox.rs#L24
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots

Environment:
Questionnaire