mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
make getModuleClassFromName: required (#36968)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36968 Changelog: [iOS][Breaking] we should be using `optional` never. this will be a breaking change if you have any class that conform to `RCTTurboModuleManagerDelegate` #saynotoruntimechecks Reviewed By: cipolleschi Differential Revision: D45022003 fbshipit-source-id: d1b3cf72bae82070704f20de4558949189da462a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
fce5aa7c5f
commit
fbf196dd05
+3
-3
@@ -19,13 +19,13 @@ RCT_EXTERN void RCTTurboModuleSetBindingMode(facebook::react::TurboModuleBinding
|
||||
|
||||
@protocol RCTTurboModuleManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Given a module name, return its actual class. If not provided, basic ObjC class lookup is performed.
|
||||
* Given a module name, return its actual class. If nil is returned, basic ObjC class lookup is performed.
|
||||
*/
|
||||
- (Class)getModuleClassFromName:(const char *)name;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Given a module class, provide an instance for it. If not provided, default initializer is used.
|
||||
*/
|
||||
|
||||
+5
-8
@@ -388,14 +388,11 @@ static Class getFallbackClassFromName(const char *name)
|
||||
/**
|
||||
* Step 2a: Resolve platform-specific class.
|
||||
*/
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(getModuleClassFromName:)]) {
|
||||
if (RCTTurboModuleManagerDelegateLockingDisabled()) {
|
||||
moduleClass = [_delegate getModuleClassFromName:moduleName];
|
||||
} else {
|
||||
std::lock_guard<std::mutex> delegateGuard(_turboModuleManagerDelegateMutex);
|
||||
moduleClass = [_delegate getModuleClassFromName:moduleName];
|
||||
}
|
||||
if (RCTTurboModuleManagerDelegateLockingDisabled()) {
|
||||
moduleClass = [_delegate getModuleClassFromName:moduleName];
|
||||
} else {
|
||||
std::lock_guard<std::mutex> delegateGuard(_turboModuleManagerDelegateMutex);
|
||||
moduleClass = [_delegate getModuleClassFromName:moduleName];
|
||||
}
|
||||
|
||||
if (!moduleClass) {
|
||||
|
||||
Reference in New Issue
Block a user