Skip to content

Remove setViewZIndex and associated state from BaseViewManager#56717

Closed
javache wants to merge 1 commit intofacebook:mainfrom
javache:export-D104101783
Closed

Remove setViewZIndex and associated state from BaseViewManager#56717
javache wants to merge 1 commit intofacebook:mainfrom
javache:export-D104101783

Conversation

@javache
Copy link
Copy Markdown
Member

@javache javache commented May 7, 2026

Summary:
This is a follow-up to D91121582 which deprecated ReactZIndexedViewGroup and removed custom draw order logic from ReactViewGroup. That diff kept setZIndex() in BaseViewManager and BaseViewManagerDelegate for backward compatibility, to be removed in a follow-up.

This diff completes that cleanup by removing:

  • The setZIndex method from BaseViewManager (which called ViewGroupManager.setViewZIndex and triggered updateDrawingOrder() on the parent)
  • The Z_INDEX case from BaseViewManagerDelegate
  • The zIndexHash WeakHashMap, setViewZIndex, and getViewZIndex static methods from ViewGroupManager's companion object
  • The ViewGroupDrawingOrderHelper class, which was dead code (marked LegacyArchitecture, no longer imported anywhere) and depended on the removed getViewZIndex

Z-index is now fully managed at the C++ Fabric layer, and these Android-side mechanisms are no longer needed.

Changelog: [Android][Removed] Removed ViewGroupDrawingOrderHelper and ReactZIndexedViewGroup

Differential Revision: D104101783

Summary:
This is a follow-up to D91121582 which deprecated ReactZIndexedViewGroup and removed custom draw order logic from ReactViewGroup. That diff kept `setZIndex()` in BaseViewManager and BaseViewManagerDelegate for backward compatibility, to be removed in a follow-up.

This diff completes that cleanup by removing:
- The `setZIndex` method from `BaseViewManager` (which called `ViewGroupManager.setViewZIndex` and triggered `updateDrawingOrder()` on the parent)
- The `Z_INDEX` case from `BaseViewManagerDelegate`
- The `zIndexHash` WeakHashMap, `setViewZIndex`, and `getViewZIndex` static methods from `ViewGroupManager`'s companion object
- The `ViewGroupDrawingOrderHelper` class, which was dead code (marked `LegacyArchitecture`, no longer imported anywhere) and depended on the removed `getViewZIndex`

Z-index is now fully managed at the C++ Fabric layer, and these Android-side mechanisms are no longer needed.

Changelog: [Android][Removed] Removed ViewGroupDrawingOrderHelper and ReactZIndexedViewGroup

Differential Revision: D104101783
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 7, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 7, 2026

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104101783.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @javache in c49aa90

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label May 7, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 7, 2026

This pull request has been merged in c49aa90.

@javache javache deleted the export-D104101783 branch May 7, 2026 17:18
j-piasecki pushed a commit to software-mansion/react-native-gesture-handler that referenced this pull request May 8, 2026
## Summary
- Remove the `getChildInDrawingOrderAtIndex` abstraction from
`ViewConfigurationHelper` and its implementation in
`RNViewConfigurationHelper`
- Inline `viewGroup.getChildAt(i)` at the two call sites
(`GestureHandlerOrchestrator` and `HoverGestureHandler`)
- `ReactViewGroup.getZIndexMappedChildIndex` is a legacy architecture
API that has been a no-op (returns its input unchanged) and has been
removed in facebook/react-native#56717

  ## Test plan
  - Android build via `cd apps/basic-example && yarn android`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants