Skip to content

Commit

Permalink
Fix RCTRCTComposedViewRegistry for Old Arch by adding count and keyEn…
Browse files Browse the repository at this point in the history
…umerator (#43850)

Summary:
In the Old Architecture and for Swift Libraries, these two methods are used to initialize a new disctionary but their implementation was missing so some libraries like lottie were failig to build.

## Changelog:
[Internal] - Implement missing `count` and `keyEnumerator` methods for RCTComposedViewRegistry

Pull Request resolved: #43850

Test Plan: Tested locally with the repro provided by SWM

Reviewed By: javache

Differential Revision: D55743648

Pulled By: cipolleschi

fbshipit-source-id: 7bdb92625341cd704b8b09920ab3223a2ca61a54
  • Loading branch information
cipolleschi authored and cortinico committed Apr 8, 2024
1 parent 57ed1bd commit 4e9196d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/react-native/React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,16 @@ - (instancetype)initWithUIManager:(RCTUIManager *)uiManager andRegistry:(NSDicti
return self;
}

- (NSUInteger)count
{
return self->_registry.count;
}

- (NSEnumerator *)keyEnumerator
{
return self->_registry.keyEnumerator;
}

- (id)objectForKey:(id)key
{
if (![key isKindOfClass:[NSNumber class]]) {
Expand Down

0 comments on commit 4e9196d

Please sign in to comment.