Migrate RCTAlertManager to handle synchronous void method execution (#56801)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56801

In preparation for enabling `enableSyncVoidMethods` (D104331837), which makes TurboModule void methods execute synchronously on the JS thread instead of being dispatched asynchronously.

Currently, this module overrides `methodQueue` to return `dispatch_get_main_queue()` so its void methods execute on the main thread. When `enableSyncVoidMethods` is enabled, the `methodQueue` override is ignored for void methods — they execute directly on the JS thread. This causes crashes for any UI operations that must run on the main thread.

**Fix:** Remove the `methodQueue` override. The `alertWithArgs` method already dispatches UI work onto the main thread via `RCTExecuteOnMainQueue`, so it is already safe.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D104771644

fbshipit-source-id: 4f1eae55c64e56990efc20c4b32af1d722520037
This commit is contained in:
Christoph Purrer authored and meta-codesync[bot] committed 2026-05-14 08:50:33 -07:00
1 parent e4cb767653
commit 0ff4c859de
1 file changed
-5
@@ -42,11 +42,6 @@ RCT_ENUM_CONVERTER(
RCT_EXPORT_MODULE()
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
- (void)invalidate
{
RCTExecuteOnMainQueue(^{