Skip to content

[Android] first onLayout dimensions are 0 #7

@Freddy03h

Description

@Freddy03h

Hello, I'm testing this lib on my project, thought react-native-screen and react-navigation.

I noticed a small regression on Android, the first onLayout event on a view inside a react-navigation is fired with a width and height to 0 (and then, immediately after, a new event with correct dimensions) with enableFreeze(true)

{"height": 0, "width": 0, "x": 0, "y": 0}
{"height": 710.1818237304688, "width": 392.7272644042969, "x": 0, "y": 0}

and by removing enableFreeze, it trigger only one event with the correct dimensions:

{"height": 710.1818237304688, "width": 392.7272644042969, "x": 0, "y": 0}

Tested on [email protected] && [email protected] with a <View> with a flex: 1 style.
Android only (emulator Android 11 and device Android 8.1), I can't reproduce it on iOS.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions