mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
mark init as designated initializer for RCTNetworking (#41252)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41252 Changelog: [Internal] let's add compile time guarantee that `RCTNetworking` must go thru `initWithDisabledObservation`. Reviewed By: cipolleschi Differential Revision: D50764524 fbshipit-source-id: fcc92411b26343bd5977dbfa1b2e95f0841e4ac8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
695a30d6b4
commit
052d20058b
@@ -28,6 +28,8 @@
|
||||
|
||||
@interface RCTNetworking : RCTEventEmitter
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/**
|
||||
* Allows RCTNetworking instances to be initialized with handlers.
|
||||
* The handlers will be requested via the bridge's moduleForName method when required.
|
||||
|
||||
@@ -170,7 +170,7 @@ RCT_EXPORT_MODULE()
|
||||
- (instancetype)initWithHandlersProvider:
|
||||
(NSArray<id<RCTURLRequestHandler>> * (^)(RCTModuleRegistry *moduleRegistry))getHandlers
|
||||
{
|
||||
if (self = [super initWithDisabledObservation]) {
|
||||
if (self = [self init]) {
|
||||
_handlersProvider = getHandlers;
|
||||
}
|
||||
return self;
|
||||
|
||||
Reference in New Issue
Block a user