Repository navigation
Replace literal dictionary keys with properties or Record - #2337
Conversation
Summary:
Replaces Flow object indexers whose key types are literal unions (for example `{[key: 'a' | 'b']: V}`) with explicit properties or `Record` / `Partial<Record>` across React Native and Metro packages.
Dictionary indexers do not require literal union keys to be present and treat finite key sets as dynamic dictionaries; explicit properties and `Record` express these finite object shapes directly with no runtime changes.
Changelog: [Internal]
Differential Revision: D136526662
|
@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D136526662. |
Metro review: Looks goodRisk: low · Commit: The PR changes two Flow types that used literal-union indexers to No findings. Verified
Not run: No benchmarks were run because the change is types-only and has no runtime effect. The watcher integration tests can't fully run in the sandbox, which blocks file watching; they fail the same way on base and head. Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
Summary:
Replaces Flow object indexers whose key types are literal unions (for example
{[key: 'a' | 'b']: V}) with explicit properties orRecord/Partial<Record>across React Native and Metro packages.Dictionary indexers do not require literal union keys to be present and treat finite key sets as dynamic dictionaries; explicit properties and
Recordexpress these finite object shapes directly with no runtime changes.Changelog: [Internal]
Differential Revision: D136526662