Repository navigation
Generate initialHidden as an optional prop for VirtualView (#58864) - #58864
Open
bartlomiejbloniarz wants to merge 1 commit into
Open
bartlomiejbloniarz wants to merge 1 commit into
bartlomiejbloniarz wants to merge 1 commit into
Conversation
|
@bartlomiejbloniarz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123029234. |
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
initialHidden as an optional prop for VirtualViewinitialHidden as an optional prop for VirtualView (#58864)
meta-codesync Bot
pushed a commit
that referenced
this pull request
Oct 6, 2026
Summary:
`VirtualViewNativeComponent` declared `initialHidden?: boolean`, which codegen generated as a plain `bool` defaulting to `false`. On Android, props equal to their C++ default are not sent when a view is created, so an explicit `initialHidden={false}` never reached `ReactVirtualViewManager.setInitialHidden`. The view's `mode` stayed `null`, so it emitted a synchronous `Visible` mode change on its first update, emitted a normally suppressed `Prerender` change, and skipped the clipping update when it first left `Visible`.
Declare the prop as `WithDefault<boolean, null>` and opt the spec into `generateOptionalProperties`, so `initialHidden` is a `std::optional<bool>` that is unset by default and an explicit `false` is sent. A plain `?: boolean` is not enough, because the Flow parser assigns it a `false` default. The `codegenNativeComponent` Flow options type gains the codegen options already declared in its TypeScript types, and iOS reads the prop with `value_or(false)`.
This changes generated APIs of VirtualView: `VirtualViewProps::initialHidden` becomes `std::optional<bool>`, and `VirtualViewManagerInterface.setInitialHidden` takes a nullable `Boolean`. The public JS API change is additive: `NativeComponentOptions` gains the optional `generateOptionalProperties` and `generateOptionalObjectProperties` fields, so the API snapshot reports `codegenNativeComponent` as changed without breaking existing callers.
Changelog: [General][Fixed] - Fix `VirtualView` initial mode when `initialHidden` is not sent on creation
Differential Revision: D123029234
meta-codesync
Bot
force-pushed
the
export-D123029234
branch
from
October 6, 2026 12:54
2d985f1 to
e0f1454
Compare
Summary:
`VirtualViewNativeComponent` declared `initialHidden?: boolean`, which codegen generated as a plain `bool` defaulting to `false`. On Android, props equal to their C++ default are not sent when a view is created, so an explicit `initialHidden={false}` never reached `ReactVirtualViewManager.setInitialHidden`. The view's `mode` stayed `null`, so it emitted a synchronous `Visible` mode change on its first update, emitted a normally suppressed `Prerender` change, and skipped the clipping update when it first left `Visible`.
Declare the prop as `WithDefault<boolean, null>` and opt the spec into `generateOptionalProperties`, so `initialHidden` is a `std::optional<bool>` that is unset by default and an explicit `false` is sent. A plain `?: boolean` is not enough, because the Flow parser assigns it a `false` default. The `codegenNativeComponent` Flow options type gains the codegen options already declared in its TypeScript types, and iOS reads the prop with `value_or(false)`.
This changes generated APIs of VirtualView: `VirtualViewProps::initialHidden` becomes `std::optional<bool>`, and `VirtualViewManagerInterface.setInitialHidden` takes a nullable `Boolean`. The public JS API change is additive: `NativeComponentOptions` gains the optional `generateOptionalProperties` and `generateOptionalObjectProperties` fields, so the API snapshot reports `codegenNativeComponent` as changed without breaking existing callers.
Changelog: [General][Fixed] - Fix `VirtualView` initial mode when `initialHidden` is not sent on creation
Reviewed By: javache
Differential Revision: D123029234
meta-codesync
Bot
force-pushed
the
export-D123029234
branch
from
October 8, 2026 14:50
e0f1454 to
520938e
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:
VirtualViewNativeComponentdeclaredinitialHidden?: boolean, which codegen generated as a plainbooldefaulting tofalse. On Android, props equal to their C++ default are not sent when a view is created, so an explicitinitialHidden={false}never reachedReactVirtualViewManager.setInitialHidden. The view'smodestayednull, so it emitted a synchronousVisiblemode change on its first update, emitted a normally suppressedPrerenderchange, and skipped the clipping update when it first leftVisible.Declare the prop as
WithDefault<boolean, null>and opt the spec intogenerateOptionalProperties, soinitialHiddenis astd::optional<bool>that is unset by default and an explicitfalseis sent. A plain?: booleanis not enough, because the Flow parser assigns it afalsedefault. ThecodegenNativeComponentFlow options type gains the codegen options already declared in its TypeScript types, and iOS reads the prop withvalue_or(false).This changes generated APIs of VirtualView:
VirtualViewProps::initialHiddenbecomesstd::optional<bool>, andVirtualViewManagerInterface.setInitialHiddentakes a nullableBoolean. The public JS API change is additive:NativeComponentOptionsgains the optionalgenerateOptionalPropertiesandgenerateOptionalObjectPropertiesfields, so the API snapshot reportscodegenNativeComponentas changed without breaking existing callers.Changelog: [General][Fixed] - Fix
VirtualViewinitial mode wheninitialHiddenis not sent on creationReviewed By: javache
Differential Revision: D123029234