clean up unused callsites to contextContainer->at (#47322)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47322

Changelog: [Internal]

these callsites were causing crashes in new bridgeless integrations, it appears they are not used, so cleaning up. after this, we can remove all callsites that insert ReactNativeConfig to the contextContainer.

Reviewed By: javache

Differential Revision: D65191733

fbshipit-source-id: 94e694ef27249773c2a39bd77f316f8f5cc2b1fb
This commit is contained in:
Phillip Pan authored and Facebook GitHub Bot committed 2024-10-31 00:56:21 -07:00
1 parent 3a68f14ac2
commit 4d90f84869
4 files changed
-12

No files matched your search

@@ -114,9 +114,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
- (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
{
if (self = [super init]) {
auto reactNativeConfig =
toolbox.contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
_delegateProxy = std::make_unique<SchedulerDelegateProxy>((__bridge void *)self);
if (ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS()) {
@@ -26,7 +26,6 @@
#import <React/RCTSurfaceView.h>
#import <React/RCTUtils.h>
#import <react/config/ReactNativeConfig.h>
#import <react/featureflags/ReactNativeFeatureFlags.h>
#import <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#import <react/renderer/components/text/BaseTextProps.h>
@@ -226,8 +225,6 @@ using namespace facebook::react;
- (RCTScheduler *)_createScheduler
{
auto reactNativeConfig = _contextContainer->at<std::shared_ptr<const ReactNativeConfig>>("ReactNativeConfig");
auto componentRegistryFactory =
[factory = wrapManagedObject(_mountingManager.componentViewRegistry.componentViewFactory)](
const EventDispatcher::Weak &eventDispatcher, const ContextContainer::Shared &contextContainer) {
@@ -31,10 +31,6 @@ Scheduler::Scheduler(
runtimeExecutor_ = schedulerToolbox.runtimeExecutor;
contextContainer_ = schedulerToolbox.contextContainer;
reactNativeConfig_ =
contextContainer_->at<std::shared_ptr<const ReactNativeConfig>>(
"ReactNativeConfig");
// Creating a container for future `EventDispatcher` instance.
eventDispatcher_ = std::make_shared<std::optional<const EventDispatcher>>();
@@ -11,7 +11,6 @@
#include <mutex>
#include <ReactCommon/RuntimeExecutor.h>
#include <react/config/ReactNativeConfig.h>
#include <react/performance/timeline/PerformanceEntryReporter.h>
#include <react/renderer/componentregistry/ComponentDescriptorFactory.h>
#include <react/renderer/components/root/RootComponentDescriptor.h>
@@ -120,7 +119,6 @@ class Scheduler final : public UIManagerDelegate {
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
RuntimeExecutor runtimeExecutor_;
std::shared_ptr<UIManager> uiManager_;
std::shared_ptr<const ReactNativeConfig> reactNativeConfig_;
std::vector<std::shared_ptr<UIManagerCommitHook>> commitHooks_;