Skip to content

Conversation

@Nitin-100
Copy link
Contributor

@Nitin-100 Nitin-100 commented Nov 30, 2025

Description

Why

The drawer navigation (hamburger menu) in the Gallery app became invisible after upgrading to React Native 0.81 with the New Architecture enabled. When clicking the hamburger button, the animation would run but the drawer content was not visible. This was caused by two breaking changes in React Native 0.81:

  1. Yoga 3.0 Layout Engine Change: The layout engine now follows strict W3C CSS standards. Using height 100% on absolutely positioned elements resolves to zero when the parent has no explicit height. This made the drawer have zero height and become invisible.
    Reference: https://www.yogalayout.dev/blog/announcing-yoga-3.0
    Reference: https://www.yogalayout.dev/docs/advanced/containing-block

  2. Fabric Renderer Stacking Order Change: The new Fabric renderer follows strict DOM render order for visual stacking. Elements rendered later in JSX appear on top. Our drawer was rendered before the main content, so the main content was covering the drawer.
    Reference: [0.82.0] Different behavior of views with position: "absolute" between old and new architecture facebook/react-native#54174

What

  1. Changed render order: Moved drawer elements to render AFTER the main content children so they appear on top in the new Fabric stacking model.

  2. Fixed absolute positioning: Replaced height 100% with top 0 bottom 0 left 0 right 0 for absolute positioned elements. This works reliably in Yoga 3.0 regardless of parent height.

  3. Added flex layout: Added flex 1 to root container and child content wrapper to provide proper dimensions for the layout hierarchy.

  4. Simplified structure: Removed unnecessary wrapper View that was interfering with the containing block hierarchy.

Backward Compatibility: These changes are backward compatible with React Native 0.80 and earlier versions. The flex and absolute positioning patterns used work identically in older versions.

Screenshots

@Nitin-100 Nitin-100 requested a review from chrisglein November 30, 2025 04:08
@Nitin-100
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s), but failed to run 1 pipeline(s).

@Nitin-100 Nitin-100 marked this pull request as draft November 30, 2025 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants