mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: While working on a fix for https://github.com/facebook/react-native/issues/29974 (I have a draft for that already (https://github.com/gabrieldonadel/react-native/pull/16), just waiting for https://github.com/facebook/react-native/pull/34406 to get merged) I noticed that the `KeyboardAvoidingView` tests on RNTester on iOS were not working with Fabric enabled because the `ModalHostView` component was still not implemented. Upon some more investigation, I found this code suggestion from Milker90 (https://github.com/facebook/react-native/issues/33652#issuecomment-1214675790) that enables the Modal component on iOS when Fabric is enabled. Closes https://github.com/facebook/react-native/issues/33652 ## Changelog [iOS] [Added] - Add support for Modal on iOS when Fabric is enabled Pull Request resolved: https://github.com/facebook/react-native/pull/34487 Test Plan: 1. With Fabric enabled open the RNTester app and navigate to the Modal page 2. Test the `Modal` component through the sections changing props https://user-images.githubusercontent.com/11707729/186289099-5223907d-b300-46bf-bfde-73259c29d544.mov Reviewed By: christophpurrer Differential Revision: D38981895 Pulled By: cipolleschi fbshipit-source-id: cd493a8d2035900da2576323bc112e2565df4834
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @generated by an internal plugin build system
|
|
*/
|
|
|
|
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
|
|
|
|
// OSS-compatibility layer
|
|
|
|
#import "RCTFabricComponentsPlugins.h"
|
|
|
|
#import <string>
|
|
#import <unordered_map>
|
|
|
|
Class<RCTComponentViewProtocol> RCTFabricComponentsProvider(const char *name) {
|
|
static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
|
|
{"SafeAreaView", RCTSafeAreaViewCls},
|
|
{"ScrollView", RCTScrollViewCls},
|
|
{"PullToRefreshView", RCTPullToRefreshViewCls},
|
|
{"ActivityIndicatorView", RCTActivityIndicatorViewCls},
|
|
{"Slider", RCTSliderCls},
|
|
{"Switch", RCTSwitchCls},
|
|
{"UnimplementedNativeView", RCTUnimplementedNativeViewCls},
|
|
{"Paragraph", RCTParagraphCls},
|
|
{"TextInput", RCTTextInputCls},
|
|
{"InputAccessoryView", RCTInputAccessoryCls},
|
|
{"View", RCTViewCls},
|
|
{"Image", RCTImageCls},
|
|
{"ModalHostView", RCTModalHostViewCls},
|
|
};
|
|
|
|
auto p = sFabricComponentsClassMap.find(name);
|
|
if (p != sFabricComponentsClassMap.end()) {
|
|
auto classFunc = p->second;
|
|
return classFunc();
|
|
}
|
|
return RCTThirdPartyFabricComponentsProvider(name);
|
|
}
|
|
|
|
#endif // RN_DISABLE_OSS_PLUGIN_HEADER
|