Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion React/Fabric/Mounting/RCTComponentViewDescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RCTComponentViewDescriptor final {
* Associated (and owned) native view instance.
*/
__strong RCTUIView<RCTComponentViewProtocol> *view = nil; // [macOS]

NSInteger tag = 0; // [macOS] default is 0
/*
* Indicates a requirement to call on the view methods from
* `RCTMountingTransactionObserving` protocol.
Expand Down
8 changes: 8 additions & 0 deletions React/Fabric/Mounting/RCTComponentViewRegistry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ - (void)preallocateViewComponents
@"RCTComponentViewRegistry: Attempt to dequeue already registered component.");

auto componentViewDescriptor = [self _dequeueComponentViewWithComponentHandle:componentHandle];
#if !TARGET_OS_OSX // [macOS]
componentViewDescriptor.view.tag = tag;
#else // [macOS
componentViewDescriptor.tag = tag;
#endif // macOS]
auto it = _registry.insert({tag, componentViewDescriptor});
return it.first->second;
}
Expand All @@ -98,7 +102,11 @@ - (void)enqueueComponentViewWithComponentHandle:(ComponentHandle)componentHandle
_registry.find(tag) != _registry.end(), @"RCTComponentViewRegistry: Attempt to enqueue unregistered component.");

_registry.erase(tag);
#if !TARGET_OS_OSX // [macOS]
componentViewDescriptor.view.tag = 0;
#else // [macOS
componentViewDescriptor.tag = 0;
#endif // macOS]
[self _enqueueComponentViewWithComponentHandle:componentHandle componentViewDescriptor:componentViewDescriptor];
}

Expand Down