Files
react-native/packages/polyfills
Rob Hogan b5b9e032c2 Fix Android JSC compatibility - replaceAll -> replace (#48076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48076

JSC for Android does not implement `String.prototype.replaceAll`:

 {F1971791988}

https://github.com/facebook/react-native/pull/47466 introduced a use of it into runtime code, breaking JSC compatibility.

This.. replaces it.. with `replace`. Since the argument is already a regex with a `g` modifier, `replaceAll` wasn't necessary anyway.

Changelog:
[ANDROID][FIXED] Fix JSC by avoiding use of unavailable `str.replaceAll()`

Reviewed By: javache

Differential Revision: D66712312

fbshipit-source-id: 534b6db6834a2fda46ae8457437de3caa24f4eb0
2024-12-04 06:07:21 -08:00
..
2024-09-12 09:23:23 -07:00

@react-native/js-polyfills

Version

Installation

yarn add @react-native/js-polyfills

Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like

Testing

To run the tests in this package, run the following commands from the React Native root folder:

  1. yarn to install the dependencies. You just need to run this once
  2. yarn jest packages/polyfills.