Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multiple view manager lookup for the interop layer on Android #43595

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,27 @@ public ViewManagerRegistry(Map<String, ViewManager> viewManagerMap) {
* @return the {@link ViewManager} registered to the className received as a parameter
*/
public synchronized ViewManager get(String className) {
// 1. Try to get the manager without the prefix.
ViewManager viewManager = mViewManagers.get(className);
if (viewManager != null) {
return viewManager;
}

// 2. Try to get the manager with the RCT prefix.
String rctViewManagerName = "RCT" + className;
viewManager = mViewManagers.get(rctViewManagerName);
if (viewManager != null) {
return viewManager;
}
if (mViewManagerResolver != null) {
// 1. Try to get the manager without the prefix.
viewManager = getViewManagerFromResolver(className);
if (viewManager != null) return viewManager;

// 2. Try to get the manager with the RCT prefix.
viewManager = getViewManagerFromResolver(rctViewManagerName);
if (viewManager != null) return viewManager;

throw new IllegalViewOperationException(
"ViewManagerResolver returned null for "
+ className
Expand Down
Loading