Align View creation flow between Fabric and non-Fabric

Summary:
Ship responsibility for most View creation logic to ViewManager, where it already largely lies, and simplify code in Fabric and non-Fabric mounting layers.

Notably, some of this work was *already* being duplicated so we can expect an extremely tiny perf gain here.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26742711

fbshipit-source-id: 4213766d4cd366bc69cd47d4654f7b269bb9e7f4
This commit is contained in:
Joshua Gross
2021-03-04 22:19:48 -08:00
committed by Facebook GitHub Bot
parent ea3495399b
commit a65cd683ae
3 changed files with 5 additions and 10 deletions
@@ -282,14 +282,6 @@ public class NativeViewHierarchyManager {
viewManager.createView(tag, themedContext, initialProps, null, mJSResponderHandler);
mTagsToViews.put(tag, view);
mTagsToViewManagers.put(tag, viewManager);
// Use android View id field to store React tag. This is possible since we don't inflate
// React views from layout xmls. Thus it is easier to just reuse that field instead of
// creating another (potentially much more expensive) mapping from view to React tag
view.setId(tag);
if (initialProps != null) {
viewManager.updateProperties(view, initialProps);
}
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_VIEW);
}