Fix incorrect unhooking for UI manager views in RCTProfileUnhookModules (#25042)

Summary:
This PR fixes incorrect unhooking for UI manager views in `RCTProfileUnhookModules`. `view` is actually a key, not the view itself; instead, use `viewForReactTag:` to obtain the view itself.

This fixes issue #24952.

## Changelog

[iOS] [Fixed] - Fix incorrect unhooking for UI manager views in `RCTProfileUnhookModules`, causing an infinite `RCTProfileTrampoline ` recursion (#24952)
Pull Request resolved: https://github.com/facebook/react-native/pull/25042

Differential Revision: D15580978

Pulled By: PeteTheHeat

fbshipit-source-id: 3483a7f6380b6fb1db4249374d86f692348c9aa2
This commit is contained in:
Leo Natan 2019-05-31 12:44:01 -07:00 коммит произвёл Facebook Github Bot
Родитель 62c605efe1
Коммит 23f578779b
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -350,7 +350,7 @@ void RCTProfileUnhookModules(RCTBridge *bridge)
if ([bridge moduleIsInitialized:[RCTUIManager class]]) {
dispatch_async(dispatch_get_main_queue(), ^{
for (id view in [bridge.uiManager valueForKey:@"viewRegistry"]) {
RCTProfileUnhookInstance(view);
RCTProfileUnhookInstance([bridge.uiManager viewForReactTag:view]);
}
dispatch_group_leave(RCTProfileGetUnhookGroup());