mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c97dcc2de5
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37796 Changelog: [internal] `global.nativeFabricUIManager` is defined as a host object in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp and every time a property of that object is accessed, the value is recreated by the host object (like in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp#L179). This is problematic because we're continuously creating copies of those methods every time we access them. As a quick solution (until we migrate the whole native implementation to a regular object with eagerly defined properties or to a TurboModule), this creates a proxy object in JavaScript to cache all properties. Reviewed By: rshest Differential Revision: D46592010 fbshipit-source-id: 38f233becd2ca130fa331d61f99ba54fbf706e13