Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
huntie
reviewed
Aug 12, 2026
Boulea7
force-pushed
the
fix/react-native-strict-api-transform
branch
from
August 12, 2026 18:37
848cb39 to
6c27484
Compare
Boulea7
force-pushed
the
fix/react-native-strict-api-transform
branch
from
August 12, 2026 18:41
6c27484 to
66b3f45
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes #53899.
MergeUnionmade every transform key optional beforeMaximumOneOfselected a key. Indexing that optional mapped type addedundefinedto each element ofViewStyle['transform']under strict null checks. This makes the intermediate keys required, preserving the existing one-key transform constraint while keepingundefinedout of the array element type.Changelog:
[General] [Fixed] - Prevent strict transform array element types from including undefined
Test Plan:
Validated against
mainatd7ff82ebe4ed5155b955fd60b31e02bbc76a3c66:yarn build-typesandyarn build-types --validate— passed; the snapshot was regenerated from Flow and is up to date.yarn test-generated-typescriptandyarn test-typescript-legacy— passed.yarn test scripts/js-api/build-types --runInBand --ci --no-cache— 21 suites, 149 tests, and 131 snapshots passed.rn_flow_tmp=$(mktemp -d) && yarn flow-check --max-workers 8 --temp-dir "$rn_flow_tmp"— passed; this is a copyable equivalent of the isolated temporary-directory invocation used for validation../node_modules/.bin/prettier --check packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js packages/react-native/ReactNativeApi.d.ts— passed../node_modules/.bin/eslint --max-warnings 0 packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js— passed.git diff --check d7ff82ebe4ed5155b955fd60b31e02bbc76a3c66 --— passed.The generated and legacy TypeScript suites use
strict: false, so they do not exercise this strict-null regression. After generating types, the following standalone command reproduces the public-type check from the repository root. It creates a temporary probe inside the checkout soreact-nativeresolves to the generated workspace types, then removes only that file and its directory even when the check fails:On unmodified main, this probe fails with TS2769 at
Object.keys(element)because the array element includesundefined. The same probe passes after the fix and regeneration. Additional temporary checks passed for single-key objects, readonly arrays, animated values, string transforms, an omitted transform, and the existing optional selected property; they also confirm rejection of undefined array elements and objects with multiple transform keys. Those boundary checks are not part of the minimal command above.No additional test script or strict TypeScript configuration is included in this PR, as requested in review.
The full repository lint and Jest suites, native builds, and RNTester were not run for this type-only change.
Codex was used for this update and its validation.