copy instanceHandle into UIManager::createNode (#41443)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41443

changelog: [internal]

instanceHandle is retained by UIManager::createNode. Let's make that obvious in the API.

Reviewed By: NickGerleman

Differential Revision: D51233821

fbshipit-source-id: b97ad80d3ac31a7830c24c8900caa723ca0e9c20
This commit is contained in:
Samuel Susla
2023-11-14 07:51:57 -08:00
committed by Facebook GitHub Bot
parent 3e3a3dbe28
commit e51a058212
3 changed files with 5 additions and 5 deletions
@@ -67,7 +67,7 @@ std::shared_ptr<ShadowNode> UIManager::createNode(
const std::string& name,
SurfaceId surfaceId,
const RawProps& rawProps,
const InstanceHandle::Shared& instanceHandle) const {
InstanceHandle::Shared instanceHandle) const {
SystraceSection s("UIManager::createNode", "componentName", name);
auto& componentDescriptor = componentDescriptorRegistry_->at(name);
@@ -76,8 +76,8 @@ std::shared_ptr<ShadowNode> UIManager::createNode(
PropsParserContext propsParserContext{surfaceId, *contextContainer_.get()};
auto family =
componentDescriptor.createFamily({tag, surfaceId, instanceHandle});
auto family = componentDescriptor.createFamily(
{tag, surfaceId, std::move(instanceHandle)});
const auto props =
componentDescriptor.cloneProps(propsParserContext, nullptr, rawProps);
const auto state = componentDescriptor.createInitialState(props, family);
@@ -135,7 +135,7 @@ class UIManager final : public ShadowTreeDelegate {
const std::string& componentName,
SurfaceId surfaceId,
const RawProps& props,
const InstanceHandle::Shared& instanceHandle) const;
InstanceHandle::Shared instanceHandle) const;
std::shared_ptr<ShadowNode> cloneNode(
const ShadowNode& shadowNode,
@@ -246,7 +246,7 @@ jsi::Value UIManagerBinding::get(
stringFromValue(runtime, arguments[1]),
surfaceIdFromValue(runtime, arguments[2]),
RawProps(runtime, arguments[3]),
instanceHandle));
std::move(instanceHandle)));
});
}