amis-rpc-design/node_modules/react-native/React/Base/RCTEventDispatcher.m

31 lines
902 B
Mathematica
Raw Normal View History

2023-10-07 19:42:30 +08:00
/*
* 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