question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

flatMap is not a function on iOS 10

See original GitHub issue

React Native version:

0.59.10

Steps To Reproduce

  1. Run your app on iOS 10
  2. Use Array.prototype.flatMap, e.g. [].flatMap(item => item)

Describe what you expected to happen: Should work like on other OS and platforms

Probably other new ES features don’t work too

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:14
  • Comments:9

github_iconTop GitHub Comments

9reactions
jd20commented, Jun 9, 2020

To support iOS 11 and below, you can add array-flat-polyfill to your project, then add to your App.js:

import 'array-flat-polyfill'

It will only add the polyfill, if it doesn’t already exist.

6reactions
fontesrpcommented, Dec 5, 2019

This is happening in RN version 0.60.4 too

Edit Now I’m seeing the issue on iOS 11 also, with "react-native": "0.61.4"

Read more comments on GitHub >

github_iconTop Results From Across the Web

flatMap method over array - (flatMap is not a function)
The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It is identical to...
Read more >
Array.prototype.flatMap() - JavaScript - MDN Web Docs
The flatMap() method returns a new array formed by applying a given callback function to each element of the array, and then flattening...
Read more >
e.children.flatMap is not a function? : r/AmazonFlexDrivers
children. flatMap is not a function. I keep closing the app and trying again. One time upon opening, a pop-up appeared above the...
Read more >
flatMap(_:) | Apple Developer Documentation
Returns an array containing the concatenated results of calling the given transformation with each element of this sequence.
Read more >
TypeError: flatMap is not a function in JavaScript | bobbyhadz
To solve the "flatMap is not a function" error, make sure to only call the flatMap method on arrays and in browsers that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found