[Polyfill needed] Array.from is unsupported in Safari 8 and Internet Explorer
See original GitHub issueIts an awesome library, however, it doesn’t work with Safari (I’ve tested Chrome and Firefox successfully).
This is the error that I get when I try to sort the items:
[Error] TypeError: undefined is not a function (evaluating 'Array.from(arr)')
and this is the line that is apparently causing the problems:
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
Any suggestions on how to solve this?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Alternative or polyfill for Array.from on the Internet Explorer
The OP basically needs to create simple array from his array-like object. ... While it's not supported on IE, you may use the...
Read more >"array from" | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >HTML forms in legacy browsers - Learn web development | MDN
The best way to polyfill missing API is by using the Modernizr library and its spin-off project: YepNope. Modernizr is a library that...
Read more >Supported Browsers and Features - Next.js
Browser support and which JavaScript features are supported by Next.js. ... by your target browsers (such as IE 11), you need to add...
Read more >Serve modern code to modern browsers for faster page loads
Here is an example of a polyfill of the Array.includes method. ... Notice how discontinued browsers, such as Internet Explorer, are included ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI The demo at http://clauderic.github.io/react-sortable-hoc doesn’t work in IE 11
I’ve added to this issue as I think it’s related?
Great. I’ve added the code that you linked and now it works even in Safari 8.
Maybe you find this information helpful. I’ve found out that this
[].slice.call("some array")
does the same thing asArray.from("some array")
and it is supported also in Safari.Thanks for the library. I really like it 🥇