Skip to content

Commit 9ac437f

Browse files
gabrieldonadelfacebook-github-bot
authored andcommitted
feat: Add support for Modal on iOS when Fabric is enabled (#34487)
Summary: While working on a fix for #29974 (I have a draft for that already (gabrieldonadel#16), just waiting for #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 (#33652 (comment)) that enables the Modal component on iOS when Fabric is enabled. Closes #33652 ## Changelog [iOS] [Added] - Add support for Modal on iOS when Fabric is enabled Pull Request resolved: #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
1 parent 2452c5f commit 9ac437f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Class<RCTComponentViewProtocol> RCTTextInputCls(void) __attribute__((used));
4242
Class<RCTComponentViewProtocol> RCTInputAccessoryCls(void) __attribute__((used));
4343
Class<RCTComponentViewProtocol> RCTViewCls(void) __attribute__((used));
4444
Class<RCTComponentViewProtocol> RCTImageCls(void) __attribute__((used));
45+
Class<RCTComponentViewProtocol> RCTModalHostViewCls(void) __attribute__((used));
4546

4647
#ifdef __cplusplus
4748
}

React/Fabric/Mounting/ComponentViews/RCTFabricComponentsPlugins.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
{"InputAccessoryView", RCTInputAccessoryCls},
3131
{"View", RCTViewCls},
3232
{"Image", RCTImageCls},
33+
{"ModalHostView", RCTModalHostViewCls},
3334
};
3435

3536
auto p = sFabricComponentsClassMap.find(name);

0 commit comments

Comments
 (0)