Pre-suppress unsafe string key access errors in xplat/js (#44221)

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

This diff pre-suppresses errors of the following pattern, to prepare for the next Flow release.

```
declare const obj: {foo: string};
declare const key: string;
obj[key]; // error: invalid-computed-prop
```

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D56477899

fbshipit-source-id: 5676b8685bd3157a519fe433cfce0fa28e003502
This commit is contained in:
Sam Zhou authored and Facebook GitHub Bot committed 2024-04-23 11:36:14 -07:00
1 parent 4928f44f70
commit 41f525ccae
22 files changed
+47 -7

No files matched your search

@@ -39,6 +39,7 @@ function generateSupportedApplePlatformsMacro(
const compilerMacroString = Object.keys(supportedPlatformsMap)
.reduce((acc: string[], platform) => {
if (!supportedPlatformsMap[platform]) {
// $FlowFixMe[invalid-computed-prop]
return [...acc, `!${APPLE_PLATFORMS_MACRO_MAP[platform]}`];
}
return acc;