Skip to content

[Android][StyleSheet] Unitless string used as value causes app crash #28654

@Simek

Description

@Simek

Description

Refs react/react-native-website#1834.

Currently when unitless string is used as property value (where number or string with unit can be used) Android application crashes, while on iOS value is converted to the number and on the web invalid property is omitted app works correctly.

React Native version:

  • Expo 37.0.0
  • React Native 0.62.2

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use unitless string as property value (where number or string with unit can be used).

Expected Results

Property with invalid value should be converted like on iOS or omitted like on the web. Also Android
app should not crash.

As a feature request, it could be nice to convert that value to number and print console warning in DEV mode.

Snack, code example, screenshot, or link to a repository:

Metadata

Metadata

Assignees

No one assigned

    Labels

    API: StyleSheetPlatform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions