Skip to content Skip to sidebar Skip to footer

React Native: .matchall Is Not A Function

I get a weird error when running my React Native app: Some sample code: const { url } = ; const reURL = ; console.debug('url:', url); cons

Solution 1:

You can use string.prototype.matchall to polyfill.

https://www.npmjs.com/package/string.prototype.matchall

import matchAll from'string.prototype.matchAll'

matchAll.shim()

Solution 2:

I have the same issue. String.matchAll does not work for Android. You should use match instead matchAll.

Example:

const regex = newRegExp(text, 'ig');
const arr = string.match(regex);

You will get an array match regex

Post a Comment for "React Native: .matchall Is Not A Function"