/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/React/Base/RCTEventDispatcher.m
39 строк
1 KB
Ramanpreet Nara
Interop: Introduce Bridge proxy
16 июн 2023, 04:05
16 июн 2023, 04:05
7bc2b73
Код
Авторство
О чём код?
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #import "RCTEventDispatcherProtocol.h" const NSInteger RCTTextUpdateLagWarningThreshold = 3; NSString *RCTNormalizeInputEventName(NSString *eventName) { if ([eventName hasPrefix:@"on"]) { eventName = [eventName stringByReplacingCharactersInRange:(NSRange){0, 2} withString:@"top"]; } else if (![eventName hasPrefix:@"top"]) { eventName = [[@"top" stringByAppendingString:[eventName substringToIndex:1].uppercaseString] stringByAppendingString:[eventName substringFromIndex:1]]; } return eventName; } @implementation RCTBridge (RCTEventDispatcher) - (id<RCTEventDispatcherProtocol>)eventDispatcher { return [self moduleForName:@"EventDispatcher" lazilyLoadIfNecessary:YES]; } @end @implementation RCTBridgeProxy (RCTEventDispatcher) - (id<RCTEventDispatcherProtocol>)eventDispatcher { return [self moduleForName:@"EventDispatcher" lazilyLoadIfNecessary:YES]; } @end