Skip to content

Commit

Permalink
Implement multiple view manager lookup for the interop layer on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldonadel committed Mar 21, 2024
1 parent 1c52d38 commit 980aa15
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ 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) {
viewManager = getViewManagerFromResolver(className);
if (viewManager != null) return viewManager;
Expand Down

0 comments on commit 980aa15

Please sign in to comment.