Repository navigation
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
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:
Add per-attribute
defaultValuepayloads for props omitted or explicitlyundefinedon initial creation. For example,{defaultValue: 13, resetValue: undefined}sends13on mount andundefinedwhen a previously supplied prop is removed. Explicitnullkeeps its normal meaning.Defaults are final payloads and bypass
process. They support nested/flattened attributes and are cached per immutable view config. Updates,setNativeProps, and Fabric visibility changes do not reapply them. Existing configurations keep their behavior; opaque values require a component whose transport accepts them.Part of #59884, stacked on #59889. Incremental diff. Includes the regenerated development, production, and profiling Fabric bundles for react#38171, which marks visibility payloads as updates. Existing Codegen and native defaults stay in place.
Changelog:
[GENERAL][ADDED] - Add defaultValue to native view attribute configurations for initial omitted or undefined props.
Test Plan:
yarn fantom 'ReactNativeAttributePayload|ReactNativeElement|/View-itest' --runInBand: 514 passed, 2 existing skips. The payload suite runs against development and production JavaScript, including native mount, update, removal, imperative updates, and hide/show behavior.yarn flow status --show-all-errors,yarn build-types, andyarn test-generated-typescriptpassed. ESLint and Prettier passed for changed source files.dc9aed364252a34966f4f2c4a98272317fdddb60plus the companion patch. The unmodified baseline bodies match RN's existing bundles exactly.