{"id":2997,"date":"2018-05-25T10:00:12","date_gmt":"2018-05-25T01:00:12","guid":{"rendered":"https:\/\/blog.timecrowd.net\/?p=2997"},"modified":"2018-05-25T10:11:15","modified_gmt":"2018-05-25T01:11:15","slug":"react-native-android-empty-array","status":"publish","type":"post","link":"https:\/\/blog.timecrowd.net\/react-native-android-empty-array\/","title":{"rendered":"React Native\u3067Android\u3060\u3051\u914d\u5217\u304c\u7a7a\u306b\u306a\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3001ReactNative\u306b\u95a2\u3059\u308b\u30af\u30a4\u30ba\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e`render`\u30e1\u30bd\u30c3\u30c9\u306fAndroid\u3067\u3069\u306e\u3088\u3046\u306a\u30d3\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u3067\u3057\u3087\u3046\u304b\u3002<br \/>\n\uff08<code>$ react-native init<\/code>\u3057\u305f\u76f4\u5f8c\u306e<code>App.js<\/code>\u3092\u66f8\u304d\u63db\u3048\u308b\u3082\u306e\u3068\u3057\u307e\u3059\u3002\uff09<\/p>\n<pre><code>render() {\r\n  const numbers = Array.from(Array(5).keys());\r\n  return (\r\n    &lt;View style={styles.container}&gt;\r\n      &lt;Text style={styles.welcome}&gt;\r\n        {numbers.join(', ')}\r\n      &lt;\/Text&gt;\r\n    &lt;\/View&gt;\r\n  );\r\n}\r\n<\/code><\/pre>\n<div id=\"toc_container\" class=\"toc_white no_bullets\"><p class=\"toc_title\">\u76ee\u6b21<\/p><ul class=\"toc_list\"><li><a href=\"#i\"><span class=\"toc_number toc_depth_1\">1<\/span> \u6b63\u89e3<\/a><\/li><li><a href=\"#i-2\"><span class=\"toc_number toc_depth_1\">2<\/span> \u6b63\u89e3\uff08\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30c3\u30b0\u4e2d\uff09<\/a><\/li><\/ul><\/div>\n<h2><span id=\"i\">\u6b63\u89e3<\/span><\/h2>\n<p>\u6b63\u89e3\u306f\u300c\u4f55\u3082\u8868\u793a\u3055\u308c\u306a\u3044\u300d\u3067\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526455598.png\" alt=\"Android\" width=\"1080\" height=\"1920\" class=\"alignnone size-full wp-image-2999\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526455598.png 1080w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526455598-768x1365.png 768w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/p>\n<h2><span id=\"i-2\">\u6b63\u89e3\uff08\u30ea\u30e2\u30fc\u30c8\u30c7\u30d0\u30c3\u30b0\u4e2d\uff09<\/span><\/h2>\n<p>\u305f\u3060\u3057\u3001\u300cDebug JS Remotely\u300d\u3057\u3066\u3044\u308b\u72b6\u614b\u3060\u3068\u3001\u60f3\u5b9a\u3069\u304a\u308a\u6570\u5b57\u306e\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" src=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526456310-1.png\" alt=\"Android Debug\" width=\"1080\" height=\"1920\" class=\"alignnone size-full wp-image-3000\" srcset=\"https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526456310-1.png 1080w, https:\/\/blog.timecrowd.net\/wp-content\/uploads\/2018\/05\/Screenshot_1526456310-1-768x1365.png 768w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><\/p>\n<p>\u307e\u305f\u3001iOS\u3067\u306f\u30c7\u30d0\u30c3\u30b0\u30e2\u30fc\u30c9\u3092\u554f\u308f\u305a\u554f\u984c\u306a\u304f\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u539f\u56e0\u306f\u3001<code>Array.from(Array(5).keys());<\/code>\u304c\u5b9f\u884c\u74b0\u5883\u306b\u3088\u3063\u3066\u9055\u3046\u7d50\u679c\u3092\u8fd4\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f\u306a\u304b\u306a\u304b\u306e\u7f60\u3067\u3059\u306d\u2026\u3002<br \/>\n\u7279\u306b\u30c7\u30d0\u30c3\u30b0\u30e2\u30fc\u30c9\u3060\u3068\u554f\u984c\u306a\u3044\u3068\u3044\u3046\u306e\u304c\u3002\u305a\u3063\u3068\u30c7\u30d0\u30c3\u30b0\u72b6\u614b\u3067\u958b\u767a\u3092\u9032\u3081\u3066\u5f8c\u304b\u3089\u6c17\u3065\u304f\u3068\u304b\u306a\u308b\u3068\u60b2\u5287\u3067\u3059\u3002<\/p>\n<p>\u4fee\u6b63\u306f\u3068\u3066\u3082\u7c21\u5358\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001\u7d20\u6734\u306a\u5f62\u3067\u914d\u5217\u3092\u4f5c\u308b\u3088\u3046\u306b\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre><code>const numbers = [];\r\n for (let i = 0; i &lt; 5; i++) {\r\n   numbers.push(i);\r\n}\r\n<\/code><\/pre>\n<p><code>core-js<\/code>\u3092import\u3059\u308b\u3068\u3044\u3046\u60c5\u5831\u3082\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u79c1\u306e\u74b0\u5883\u3067\u306f\u5225\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<br \/>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"no_icon\" href=\"https:\/\/github.com\/facebook\/react-native\/issues\/4841\" target=\"_blank\"><div class=\"lkc-card\"><div class=\"lkc-content\"><span class=\"lkc-thumbnail\"><img class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fgithub.com%2Ffacebook%2Freact-native%2Fissues%2F4841?w=100\" alt=\"\" \/><\/span><span class=\"lkc-title\">[Android] es6 Polyfills \u00b7 Issue #4841 \u00b7 facebook\/react-native<\/span><div class=\"lkc-url\"><cite>https:\/\/github.com\/facebook\/react-native\/issues\/4841<\/cite><\/div><div class=\"lkc-excerpt\">Hey,I&#039;ve found a few es6 polyfils which behave differently to how they should on android. They work fine on iOS and work fine when you run on android with debug enabled.var s = new Set([1,2,3...<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div><\/p>\n<p>\u4eca\u56de\u3001\u5143\u3005iOS\u5411\u3051\u306b\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u305f\u30a2\u30d7\u30ea\u306eAndroid\u30b5\u30dd\u30fc\u30c8\u3092\u9032\u3081\u308b\u4e2d\u3067\u3053\u306e\u4e8b\u8c61\u306b\u51fa\u4f1a\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u300cReact Native\u3067iOS\u5411\u3051\u306b\u4f5c\u3063\u3066\u3001\u5f8c\u304b\u3089Android\u306b\u3082\u5bfe\u5fdc\u3055\u305b\u308b\u300d\u3068\u3044\u3046\u30d5\u30ed\u30fc\u306f\u3068\u3066\u3082\u30aa\u30b9\u30b9\u30e1<strong>\u3067\u304d\u307e\u305b\u3093<\/strong>\u3002\uff08Chrome\u3067\u3057\u304b\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u306a\u3044Web\u30a2\u30d7\u30ea\u3092\u3001\u5f8c\u304b\u3089\u5225\u30d6\u30e9\u30a6\u30b6\u306b\u5bfe\u5fdc\u3055\u305b\u308b\u3088\u3046\u306a\u4f5c\u696d\u306b\u4f3c\u3066\u3044\u307e\u3059\u3002\u8f9b\u3044\u2026\uff09<\/p>\n<p>\u305b\u3063\u304b\u304fReact Native\u3092\u4f7f\u3046\u306e\u3067\u3042\u308c\u3070\u3001\u6700\u521d\u304b\u3089\u4e21OS\u3092\u8003\u616e\u3057\u3066\u9032\u3081\u3066\u304a\u3044\u305f\u65b9\u304c\u3001\u7d76\u5bfe\u697d\u3067\u3059\u3088\uff01\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"\u3055\u3066\u3001ReactNative\u306b\u95a2\u3059\u308b\u30af\u30a4\u30ba\u3067\u3059\u3002 \u4ee5\u4e0b\u306e`render`\u30e1\u30bd\u30c3\u30c9\u306fAndroid\u3067\u3069\u306e\u3088\u3046\u306a\u30d3\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u3067\u3057\u3087\u3046\u304b\u3002 &#8230;","protected":false},"author":4,"featured_media":3003,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":""},"categories":[5],"tags":[12],"_links":{"self":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/2997"}],"collection":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/comments?post=2997"}],"version-history":[{"count":10,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/2997\/revisions"}],"predecessor-version":[{"id":3043,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/posts\/2997\/revisions\/3043"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/media\/3003"}],"wp:attachment":[{"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/media?parent=2997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/categories?post=2997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.timecrowd.net\/wp-json\/wp\/v2\/tags?post=2997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}