Skip to content

CustomFabricUIManager is accessing Fabric Internals #693

@cortinico

Description

@cortinico

Hey all,
Nicola from the React Native team here.

Just touching base because I noticed that CustomFabricUIManager is accessing Fabric Internals via reflection:

Field mountingManagerField = uiManagerClass.getDeclaredField("mMountingManager");
mountingManagerField.setAccessible(true);
ReactApplicationContext reactContext = readPrivateField(source, "mReactApplicationContext");
ViewManagerRegistry viewManagerRegistry = readPrivateField(source, "mViewManagerRegistry");
BatchEventDispatchedListener batchEventDispatchedListener = readPrivateField(source, "mBatchEventDispatchedListener");
MountingManager.MountItemExecutor mountItemExecutor = readPrivateField(source, "mMountItemExecutor");
FabricUIManager customFabricUIManager = new FabricUIManager(reactContext, viewManagerRegistry, batchEventDispatchedListener);
mountingManagerField.set(customFabricUIManager, new CustomMountingManager(viewManagerRegistry, mountItemExecutor, reactContext, markdownProps, parserId));
return customFabricUIManager;

This is obviously not ideal an extremely brittle. I suspect this will break in 0.81 so I'm reaching out with ample time to make sure we find a workaround for this usage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions