Fix isBatchActive of RCTCxxBridge (#22785)
Summary: Seems we lost handler of `isBatchActive` from [RCTBatchedBridgea86171a
](a86171a482/React/Base/RCTBatchedBridge.m
) to [RCTCxxBridge5bc7e39
](b774820dc2 (diff-a2a67635fffd7b690d14dc17ae563a71)
). Changelog: ---------- [iOS] [fixed] - Fix isBatchActive of RCTCxxBridge Pull Request resolved: https://github.com/facebook/react-native/pull/22785 Reviewed By: mhorowitz Differential Revision: D13731897 Pulled By: cpojer fbshipit-source-id: 8d6b85bcea8fe8997a93b4e1ac8b8007422ca20e
This commit is contained in:
parent
be51dbc214
commit
d55558e138
|
@ -152,7 +152,6 @@ struct RCTInstanceCallback : public InstanceCallback {
|
|||
|
||||
@implementation RCTCxxBridge
|
||||
{
|
||||
BOOL _wasBatchActive;
|
||||
BOOL _didInvalidate;
|
||||
BOOL _moduleRegistryCreated;
|
||||
|
||||
|
@ -1348,7 +1347,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithBundleURL:(__unused NSURL *)bundleUR
|
|||
|
||||
- (BOOL)isBatchActive
|
||||
{
|
||||
return _wasBatchActive;
|
||||
return _reactInstance ? _reactInstance->isBatchActive() : NO;
|
||||
}
|
||||
|
||||
- (void *)runtime
|
||||
|
|
|
@ -149,6 +149,10 @@ void *Instance::getJavaScriptContext() {
|
|||
bool Instance::isInspectable() {
|
||||
return nativeToJsBridge_ ? nativeToJsBridge_->isInspectable() : false;
|
||||
}
|
||||
|
||||
bool Instance::isBatchActive() {
|
||||
return nativeToJsBridge_ ? nativeToJsBridge_->isBatchActive() : false;
|
||||
}
|
||||
|
||||
void Instance::callJSFunction(std::string &&module, std::string &&method,
|
||||
folly::dynamic &¶ms) {
|
||||
|
|
|
@ -58,6 +58,7 @@ public:
|
|||
std::unique_ptr<const JSBigString> jsonValue);
|
||||
void *getJavaScriptContext();
|
||||
bool isInspectable();
|
||||
bool isBatchActive();
|
||||
void callJSFunction(std::string &&module, std::string &&method,
|
||||
folly::dynamic &¶ms);
|
||||
void callJSCallback(uint64_t callbackId, folly::dynamic &¶ms);
|
||||
|
|
|
@ -37,6 +37,10 @@ public:
|
|||
std::shared_ptr<ModuleRegistry> getModuleRegistry() override {
|
||||
return m_registry;
|
||||
}
|
||||
|
||||
bool isBatchActive() {
|
||||
return m_batchHadNativeModuleCalls;
|
||||
}
|
||||
|
||||
void callNativeModules(
|
||||
JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override {
|
||||
|
@ -222,6 +226,10 @@ void* NativeToJsBridge::getJavaScriptContext() {
|
|||
bool NativeToJsBridge::isInspectable() {
|
||||
return m_executor->isInspectable();
|
||||
}
|
||||
|
||||
bool NativeToJsBridge::isBatchActive() {
|
||||
return m_delegate->isBatchActive();
|
||||
}
|
||||
|
||||
void NativeToJsBridge::handleMemoryPressure(int pressureLevel) {
|
||||
runOnExecutorQueue([=] (JSExecutor* executor) {
|
||||
|
|
|
@ -75,6 +75,7 @@ public:
|
|||
void setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue);
|
||||
void* getJavaScriptContext();
|
||||
bool isInspectable();
|
||||
bool isBatchActive();
|
||||
|
||||
void handleMemoryPressure(int pressureLevel);
|
||||
|
||||
|
|
Loading…
Reference in New Issue