2019-10-16 20:03:47 +03:00
|
|
|
/*
|
2021-12-31 02:08:43 +03:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2015-03-23 23:28:42 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-03-23 23:28:42 +03:00
|
|
|
*/
|
2015-02-20 07:10:52 +03:00
|
|
|
|
2020-10-14 12:37:51 +03:00
|
|
|
#import "RCTEventDispatcherProtocol.h"
|
2015-05-28 06:15:33 +03:00
|
|
|
|
2015-07-21 22:37:24 +03:00
|
|
|
const NSInteger RCTTextUpdateLagWarningThreshold = 3;
|
|
|
|
|
2015-08-11 16:37:12 +03:00
|
|
|
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]
|
2020-03-09 08:58:01 +03:00
|
|
|
stringByAppendingString:[eventName substringFromIndex:1]];
|
2015-08-11 16:37:12 +03:00
|
|
|
}
|
|
|
|
return eventName;
|
|
|
|
}
|
|
|
|
|
2016-04-28 15:47:29 +03:00
|
|
|
@implementation RCTBridge (RCTEventDispatcher)
|
|
|
|
|
2020-10-14 12:37:51 +03:00
|
|
|
- (id<RCTEventDispatcherProtocol>)eventDispatcher
|
2016-04-28 15:47:29 +03:00
|
|
|
{
|
2020-10-14 12:37:51 +03:00
|
|
|
return [self moduleForName:@"EventDispatcher" lazilyLoadIfNecessary:YES];
|
2016-04-28 15:47:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|