SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 0 C++

fix(style)(backgroundSize) - Passing unsupported backgroundSize on android causes crash (#55904)

Summary:
Below snippet would lead to divide by zero crash on android. Currently, "`cover` | `contain`" keywords are not supported for background size as these only work on actual images (`url()` syntax) and not on gradients. These keywords were supposed to be removed in this [commit](https://github.com/facebook/react-native/pull/52282/changes/34c041ce1e13eddbc51bd473c6d241e3ca040887) and added later in this [PR](https://github.com/facebook/react-native/pull/54994)

```jsx
<View
  style={{
    experimental_backgroundImage: "radial-gradient(circle, #f093fb, #f5576c)",
    experimental_backgroundSize: "cover",
    width: 100,
    height: 100
  }}
/>;

```

## Changelog:

[ANDROID] [FIXED] - Unsupported background size value leading to crash

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: https://github.com/facebook/react-native/pull/55904

Test Plan: Tested the BackgroundImage example on RNTester.

Reviewed By: christophpurrer

Differential Revision: D95202400

Pulled By: NickGerleman

fbshipit-source-id: 287f4710c4afc031b7f5e080f544e8dadfc007d2
N
nishan (o^▽^o) committed
fe046dc7822761322a2eea1bf0ba8a000a4ae8cc
Parent: 540120a
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 3/19/2026, 2:18:00 AM