Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatMap is not a function on iOS 10 #26283

Closed
gazedash opened this issue Aug 31, 2019 · 9 comments
Closed

flatMap is not a function on iOS 10 #26283

gazedash opened this issue Aug 31, 2019 · 9 comments
Labels
Bug Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@gazedash
Copy link

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:

@gazedash gazedash added the Bug label Aug 31, 2019
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Aug 31, 2019
@fontesrp
Copy link

fontesrp commented Oct 24, 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"

@stale
Copy link

stale bot commented Mar 4, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 4, 2020
@yilinjuang
Copy link

Still seeing this on react native 0.61.5 iOS 11

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Mar 6, 2020
@vijayst
Copy link

vijayst commented Apr 1, 2020

I am seeing this on iOS 11.3 and Expo 36 version of React native.

@manjuy124
Copy link

Seems flatMap will work iOS 12 and above only.

Safari iOS added support from iOS 12 onwards - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap

@anka-213
Copy link

anka-213 commented Apr 2, 2020

How would you configure react-native to use a polyfill for flatMap on systems that don't support it?

@jd20
Copy link

jd20 commented 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.

@stale
Copy link

stale bot commented Sep 7, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Sep 7, 2020
@stale
Copy link

stale bot commented Sep 14, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Sep 14, 2020
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Apr 15, 2021
-- NEEDS CURRENT USAGE NUMBERS AND A REASON FOR BUMPING GRACEFUL
DEGRADATION THRESHOLD --

We'd like to use `Array.prototype.flatMap`, which it seems won't
work in React Native on iOS until iOS 12. This was noted in a
comment [1] on facebook/react-native#26283. While the reasoning
there wasn't as thorough as we'd like, we looked closer [2], and we
believe the conclusion is correct.

[1] facebook/react-native#26283 (comment)
[2] https://chat.zulip.org/#narrow/stream/48-mobile/topic/platform.20versions/near/1163034
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Apr 16, 2021
We'd like to use `Array.prototype.flatMap`, which it seems won't
work in React Native on iOS until iOS 12. This was noted in a
comment [1] on facebook/react-native#26283. While the reasoning
there wasn't as thorough as we'd like, we looked closer [2], and we
believe the conclusion is correct.

A fresh look at iOS installations by platform (or the proxy we use
for that, anyway) [3] shows iOS 11 usage is 0.1% of our iOS usage,
so this should be fine to do. Also, 5.9% of our iOS users are on iOS
<= 13, so graceful degradation at that level is fine.

[1] facebook/react-native#26283 (comment)
[2] https://chat.zulip.org/#narrow/stream/48-mobile/topic/platform.20versions/near/1163034
[3] https://chat.zulip.org/#narrow/stream/48-mobile/topic/platform.20versions/near/1164857
@facebook facebook locked as resolved and limited conversation to collaborators Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

8 participants