Skip to content

View is missing flex-shrink #2763

@MateWW

Description

@MateWW

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

I've noticed discrepancy between web and native.
Initially I thought it's Yoga bug but thank to Nick it turned out that View component is compatible on web.

Original issue

The issue is that View on native while set with flex: 1 it translates to flex-grow: 1 + flex-shrink: 1

On web platform it just sets flex-grow: 1 while what leads to different behaviour in some cases.

iOS Android Web
Image Image Image

Expected behavior

Equal behaviour on both native and web

Steps to reproduce

  1. Open linked snack
  2. See Web, Android and iOS

Test case

https://snack.expo.dev/@matew/yoga-rendering-issue

Additional comments

I believe it's small change code wise but most likely drastic change for users.
My hope is to start some discussion and see different PoV

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions