Files
react-native/packages
Riccardo Cipolleschi 8d710bfaca Refactor RCT_handleKeyCommand to avoid concurrency issues (#42708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42708

When pressing `r` on simulator in Bridgeless mode, we have a race condition between:
- RCTKeyCommands evaluating the blocks to be invoked
- ReactNative invalidating the DevMenu with the list of RCTKeyCommands (on which ReactNative is iterating).

The fix checks which commands need to be executed, stores them in an array and then iterates on the array, which is local to the function call, avoiding any concurrency issue.

## Changelog:
[iOS][Fixed] - Refactored RCT_handleKeyCommand to avoid concurrency issues

Reviewed By: motiz88

Differential Revision: D53186262

fbshipit-source-id: 60ae8974a9df7289395c8a9e9abe2e34e4c40309
2024-01-30 03:12:50 -08:00
..
2024-01-29 18:54:14 -08:00