ãªãããªãŒã©ã³ã¹ãéžãã ã®ã§ããïŒ
æšå¹Ž5æãç§ã¯1ã€ã®çŽ æŽãããããªãŒã©ã³ã¹ãããžã§ã¯ããç«ã¡äžããŸããã åœæãç§ã¯ã¹ããã¯ãã«ã ã®ã¹ã¿ãŒãã¢ããã®ãã«ã¹ã¿ãã¯éçºè ã§ããã ããã¯ç§ã®æåã®ããã°ã©ãã³ã°ã®ä»äºã§ããããã¡ããã©1幎åã«ããã«çããŸããïŒ ããã§ããã«ã€ããŠè©³ãã説æããŸãïŒã
å€ã¯æ¥éã«è¿ã¥ããŠãããä»äºã®ããŒã¹ã¯ããã®çæ°ã®åã«ãæ¥ã ç©ããã«ãªã£ãŠããŸããã åªå é äœã®é«ãé ã«ãæè¡ãµããŒãã«å¯Ÿå¿ããªããã°ãªããªãã£ãé±ããã£ãã ç§ã¯ããã€ãã®ééãã«å¯ŸåŠããªããã°ãªããªãã£ããç§ã¯å°ãéå±ããŠãããä»äºã¯ç§ãåã°ããŸããã§ããã
ç§ãéåžžã«æ鬱ãªæ°åã«ãªã£ããšããç¶ã¯äŒç€Ÿã®ã¯ã©ã€ã¢ã³ãåãã®ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãäœæããæåãç§ã«ç¥ãããŸããã 圌ã¯ç§ãä»äºã§å¿ããããšãç¥ã£ãŠããŠã圌ã®ã¢ã€ãã¢ãå®è£ ããããã«ãã¹ãŠã®æéãå²ãããšãæåŸ ããŠããŸããã§ãããã圌ã¯ç§ããã®æ°ãããããžã§ã¯ãã§äœããã®ã³ã³ãµã«ã¿ã³ãã«ãªããããã©ããå°ããŸããã ãããããç§ã¯é¢çœãã¡ã³ã¿ã«ã¯ãŒã¯ã«é£¢ããŠãããšæããããã圌ã®è³ªåã«ååãã«çããŸããã æåã¯ãããèšç»ããŠããŸããã§ããããã³ã³ãµã«ã¿ã³ãããç§ã¯çµæãšããŠãäž»èŠãªã¢ããªã±ãŒã·ã§ã³éçºè ã«ãªããŸããã
ããã§ã誰ããããã®Webéçºè ãšããŠ1幎éåããŠããªãã£ãã®ã«ããªãã¢ãã€ã«éçºãè©Šã¿ãããšããã®ãçåã«æããããããŸããã éžã°ãããããã§çµéšãç©ã¿ç¶ããå°éçã«æé·ããå°è±¡çãªå±¥æŽæžãäœæããæ¹ãè³¢æã§ã¯ãªãã§ããããïŒ
ãããã¯ããã«åççã§ããããšã«å®å šã«åæããŸãã ããããç§ã¯æ°å¹Žåã«ç¹å®ã®æŠç¥ã§ã¯ãªããèªåã®å¥œã¿ã«åºã¥ããŠãã£ãªã¢ã決å®ããããšã決ãã絶æçãªããã«ãã¹ããŒã·ã§ã³ã¯ãŒã«ãŒãã§ãã ç§ã¯ç§ã«åã³ããããããã®ãããããšã«ããŸããã èšãæããã°ãç§ã®å±¥æŽæžã¯ãä»ãããããã«äžå®å®ãªç¶æ ã«ãªãããšã¯ã»ãšãã©ãªãããã«èŠããŸãã
ãã¡ããã奜ããªããšãããŠãã£ãªã¢æŠç¥ãè¿œæ±ããããšã¯ãå¿ ãããçžäºã«æä»çãªçŸè±¡ã§ã¯ãããŸããã å®éã以åã®ä»äºãšéçšäž»ã®äž¡æ¹ãæ¬åœã«å¥œãã§ããã å¶ç¶ãå¥ã®ãããžã§ã¯ãã«åºããããŸããããã®æ¬²æ±ã¯ã以åãã£ãŠããããšããããããšããé¡æããã匷ãããšãããããŸããã
ãã®ãããžã§ã¯ããç§ã«ãšã£ãŠé åçã ã£ãã®ã¯ãªãã§ããïŒ ç§ãåºäŒã£ãæé«ã®äººã ã§æ§æãããããŒã ã®äžå¡ãšããŠãäœåãã®äŒæ¥ã§äœ¿çšãããŠããæ¥éã«éçºãããŠãã補åã«åãçµããããã圌ãããé¢çœãããã®ã¯ãªãã§ããïŒ ãã®è³ªåã«ã¯æ¬¡ã®ããã«çããããšãã§ããŸããããã¯èªç±ã§ãããããã¯ç§ã«å°é£ãªåé¡ã解決ããå¿ èŠæ§ãäžããææŠã§ãããããã¯èªå·±éçºãžã®æ¬²æã§ãã
React Nativeã䜿çšããããšã«æ±ºããã®ã¯ãªãã§ããïŒ
ç§ããããžã§ã¯ãã«åå ããé ã«ã¯ãç§ã®ã¯ã©ã€ã¢ã³ãã¯ãã§ã«å°å ã®ããžã¿ã«ãšãŒãžã§ã³ã·ãŒããããã€ãã®ãªãã¡ãŒãåãåã£ãŠããŸããã ã¢ããªã±ãŒã·ã§ã³ãç¬èªã«éçºããå¯èœæ§ãæ€èšããåããããããã®ææ¡ãè©äŸ¡ããããã«å奜çãªæ¹æ³ã§å°ããããŸããã ããããèŠããšããç§ã¯åœŒãã®äœå質ã«åã«é©ããã
代çåºã®1ã€ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãã¶ã€ã³ã®æŠèŠãéä¿¡ããŸããããããã¯ã ãããªãèŠããã ãã§ãªããã¯ã©ã€ã¢ã³ãã®ãµã€ãã«åæ ãããã³ãŒãã¬ãŒãã¢ã€ãã³ãã£ãã£ã«ã察å¿ããŠããŸããã§ããã å¥ã®ãã®ã¯ãéçºãšãããžã§ã¯ãæ¯æŽã®äž¡æ¹ã®ããã«ãéåžžã«é«ãäŸ¡æ ŒãæäŸããŸããã 3çªç®ã¯ãã¯ã©ã€ã¢ã³ãã®èŠä»¶ãå®éã«æ€èšããããšãªããææ¡ãéä¿¡ããããã§ãã ææ¡ãæåºãããã¹ãŠã®ä»£çåºã«ã¯å ±éã®ç¹åŸŽããããŸããã圌ãã¯Cordovaãã€ããªãããã¬ãŒã ã¯ãŒã¯ã䜿çšããŠã¢ããªã±ãŒã·ã§ã³ãäœæããããšããŠããŸããã
ããããããã ãã§ã¯ãããŸããã Cordovaã¯å®å šã«ç¡æã®ãªãŒãã³ãœãŒã¹ããŒã«ã§ãããããæ©é¢ã¯ãCordovaã䜿çšããŠããç¹å®ã®ãã¯ãããžãŒã«é¢ããæ å ±ãé ãããšããŸããã 代ããã«ã代çåºã®ä»£è¡šè ã¯ã瀟å ã§äœæãããã瀟å ãã¢ãã€ã«ã¢ããªéçºãã©ãããã©ãŒã ã«ã€ããŠè©±ããŸããã ã¢ããªã±ãŒã·ã§ã³ã®ãµãŒãã¹ã«é¢ãããã®æ©é¢ã®ç¬å çæš©å©ããã£ãããšç¢ºä¿ãã顧客ã®å¥ã®éçºè ãžã®å°æ¥ã®ç§»è¡ãå°é£ãã€é«äŸ¡ã«ããããã«ã®ã¿äœããããã³ã«ããã®å°ããªã¢ããªã³ã«ã€ããŠè©±ããŠããããã§ãã äžè¬ã«ãåé¡ã®ææ¡ã¯ç¹ã«å°è±¡çã§ã¯ãããŸããã§ããã
ãã€ããªãããã¬ãŒã ã¯ãŒã¯ã«å察ãããã®ã¯äœããªãããšã«æ³šæããŠãã ããã ç§ã¯åžžã«ãããã«åºã¥ããã¢ããªã±ãŒã·ã§ã³ã䜿çšããŠããŸãã ããã¯ãããšãã°ãGmailãSlackãAtomãFigmaã§ãã ãããããã®åŸãReact Nativeã«ã€ããŠããã®ã©ã€ãã©ãªã䜿çšããŠããã€ããªããã§ã¯ãªãJavaScriptã䜿çšããŠã¯ãã¹ãã©ãããã©ãŒã ã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãäœæããæ¹æ³ã«ã€ããŠèããããšããããŸãã
ãããŠä»äœïŒ ãã€ãã£ãã®JavaScriptã¢ããªã±ãŒã·ã§ã³ãéçºããéã«ãiOSãšAndroidããµããŒãããå¿ èŠããããŸããïŒ ãã®è³ªåã¯ãç§ãåæ§ã®ã¢ããªã±ãŒã·ã§ã³ã«èå³ãæã£ããšãã«ãiOSã¢ããªã±ãŒã·ã§ã³ãObjective-CãŸãã¯Swiftã䜿çšããŠèšè¿°ãããJavaãŸãã¯KotlinãAndroidã¢ããªã±ãŒã·ã§ã³ã®éçºã«äœ¿çšããããšããäºå®ããçããŸããã
ãã¡ãããããã«ã¯ç¹å¥ãªããªãã¯ã¯ãããŸããã ããã§ããäžã€è³ªåããããŸããã React Nativeã¢ããªã±ãŒã·ã§ã³ãçã®ãã€ãã£ãã¢ããªã±ãŒã·ã§ã³ãšåŒã¶ã«ã¯ã©ãããã°ããã§ããïŒ ãã®è³ªåã«äžèšã§çãããšããã¹ãŠãAPIã«ããããšãããããŸãã èªããããããããç解ããã®ã«æéãããããŸãããããã€ãã£ããšåŒã°ããReact Nativeã¢ããªã±ãŒã·ã§ã³ãã¢ãã€ã«ãã©ãããã©ãŒã ã§åäœããæ¹æ³ã¯ãJavaScriptã³ãŒãã®èµ·åããã®ãããªã³ãŒãã®ã³ã³ãã€ã«ã«ãããŸãããã€ãã£ãã³ãŒãã åé¡ã¯ããããã®ã¢ããªã±ãŒã·ã§ã³ããiPhoneã®Objective-CãšAndroidã®Javaã䜿çšããŠãã€ãã£ãã³ã³ããŒãã³ãã衚瀺ããAPIãªã¯ãšã¹ããå®è¡ããããšã§ãã
React Nativeã®åºæ¬ãããæ·±ãç解ãããå Žåã¯ã Quoraãžã®ãã®åçããå§ãããŸãã ãã㯠React Confã®ãã¬ãŒã³ããŒã·ã§ã³ã§ãããReact Nativeã®ãªãªãŒã¹ã«ã€ããŠèª¬æããŠãããã®è³æã§ãã
ãã®æç¹ã§ã¯ãReact Nativeã¢ããªã±ãŒã·ã§ã³ã®è žå ã§äœãèµ·ãã£ãŠããã®ãæ£ç¢ºã«ã¯ããããŸããã§ãããããã®ãããªã¢ããªã±ãŒã·ã§ã³ã®äœæ¥ã¯ãã€ãã£ãã³ãŒãã®å®è¡ã«éå®ãããããšãç¥ã£ãŠããŸããã ããã¯ã代çåºãæäŸããCordovaããŒã¹ã®ãœãªã¥ãŒã·ã§ã³ã®1ã€ãéžæããããšã«å¯Ÿããç§ã®äž»ãªè°è«ã§ããã äŒæ¥ãã¢ãã€ã«ã¢ããªã±ãŒã·ã§ã³ãå¿ èŠãšããå Žåããã®ã¢ããªã±ãŒã·ã§ã³ã¯ãã€ãã£ãã§ããå¿ èŠããããšèããŸããã HTML / CSS / JSã«åºã¥ããŠæ§ç¯ãããã¢ããªã±ãŒã·ã§ã³ãå¿ èŠãªå ŽåãWebã¢ããªã±ãŒã·ã§ã³ã®ã¢ãã€ã«æ©èœãæ¹åããããã ãã«ãéã䜿ãæ¹ãè¯ãã§ãããã
ãã®æšè«ãã¯ã©ã€ã¢ã³ããšå ±æãããšã圌ã¯ç§ã«ãã®ãããªã¢ããªã±ãŒã·ã§ã³ãäœæã§ãã人ãç¥ã£ãŠãããã©ããã«ã€ããŠè³ªåããŸããã ç§ã¯ç¥ããªããšçããã ãããã圌ãã¯ç§ã«èªåã§ã§ããããšå°ããŸããã ãã§ããŸããããšç§ã¯çããã ãããããã®é ã«ã¯ãã§ã«ãã®ãã¹ãŠã«èå³ããããReact Nativeã§å®éšããã®ããããããšãã§ããŸããã§ãããã¢ããªã±ãŒã·ã§ã³ã®ä»æ§ãå®éšã®åºç€ã«ããŠããŸãã
ãããèªåã§å®çŸããåã«ãã¢ããªã±ãŒã·ã§ã³ã®åºç€ãäœæããããšãã§ããŸããã ãã®çµæããã®äŒè©±ã®ãããæ°é±éåŸã«ãã¯ã©ã€ã¢ã³ããšç§ã¯åœŒã®ããã«ã¢ããªã±ãŒã·ã§ã³ãéçºããããšã«åæããŸããã
ã¢ããªã±ãŒã·ã§ã³ä»æ§
æè¡çãªè©³çŽ°ã«å ¥ãåã«ãã©ã®ã¢ããªã±ãŒã·ã§ã³ãæ±ã£ãŠãããã«ã€ããŠå°ãã話ããããšæããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®éçºå¯Ÿè±¡ãšãªãã¯ã©ã€ã¢ã³ãã¯ãã¹ããã¯ãã«ã ã®äŒç€Ÿã§ãããã³ã¯ãŒãã³ã°ãéåãªãã£ã¹ã®ç®¡çã«åŸäºããŠããŸãã èšãæããã°ãç§ãã¡ã¯ããŸããŸãªäŒæ¥ãã¬ã³ã¿ã«ã§ãããªãã£ã¹ã¹ããŒã¹ã«ã€ããŠè©±ããŠããã®ã§ãã çŸæç¹ã§ã¯ãç§ã®ã¯ã©ã€ã¢ã³ãã«ã¯çŽ10ã®æ¢åã®ãªãã£ã¹ãããã1,400人ã®åŸæ¥å¡ãæã€çŽ400ã®äŒç€Ÿãã¹ããŒã¹ãã¬ã³ã¿ã«ããŠããŸãã ãããã¯ãªãã£ã¹ã®ããã³ãã§ãããã¢ããªã±ãŒã·ã§ã³ã®å¯Ÿè±¡èªè ã§ãã
ã³ã¯ãŒãã³ã°ã®1ã€ã®ã¬ã¯ãªãšãŒã·ã§ã³ãšãªã¢
ãããžã§ã¯ããããŒãžã£ãŒãšå°æ¥ã®ã¢ããªã±ãŒã·ã§ã³ã«ã€ããŠè©±ãåã£ãåŸããããžã§ã¯ãã®ããã€ãã®èŠä»¶ãèŠã€ããããšãã§ããŸããã
- ãã°ã€ã³ããã°ã¢ãŠããããã³ãã¹ã¯ãŒãããªã»ããããæ©èœã ãã¹ãŠã®ãŠãŒã¶ãŒã¢ã«ãŠã³ãã¯ç®¡çè ã«ãã£ãŠäœæãããã¢ããªã±ãŒã·ã§ã³ã¯ã·ã¹ãã ãžã®ç»é²ããµããŒãããŠããªãããšã«æ³šæããŠãã ããã ãããã£ãŠããã®ã¢ããªã±ãŒã·ã§ã³ãããŠã³ããŒãããããšã«ããå Žåãããã䜿çšããããšã¯ã§ããŸããã
- ãŠãŒã¶ãŒãããã£ãŒã«ã®è¡šç€ºãšç·šéïŒååãã¡ãŒã«ã¢ãã¬ã¹ããã¹ã¯ãŒããã¢ãã¿ãŒã
- ããã·ã¥éç¥ã®ãµããŒãã
- ãŠãŒã¶ãŒãäŒç€Ÿå šäœã®ãã¥ãŒã¹ãç¹ã«äŒç€Ÿãåããã³ã¯ãŒãã³ã°ã«é¢ãããã¥ãŒã¹ãç¥ãããšãã§ããããŒã ã»ã¯ã·ã§ã³ã
- ãŠãŒã¶ãŒãããŸããŸãªã³ã¯ãŒãã³ã°ã«é¢ããæ å ±ã衚瀺ãããããããŒãžã£ãŒã«é£çµ¡ããããç¹å®ã®ã³ã¯ãŒãã³ã°ã«åŸäºããŠããäŒç€Ÿã確èªãããã§ããã³ãã¥ããã£ã»ã¯ã·ã§ã³ã
- äŒè°å®€ãäŒè°å®€ãäºçŽããäºçŽã管çã§ããŸãã
- ã»ã¯ã·ã§ã³ã®éžæããŠãŒã¶ãŒã¯æä»çãªå²åŒããªãã¡ãŒãèŠã€ããããšãã§ããŸãã
- æåã«iOSããŒãžã§ã³ãäœæããŠãããAndroidãµããŒããè¿œå ããå¿ èŠããããŸãã
- 管çè åãã®WebããŒã¹ã®ã¢ããªã±ãŒã·ã§ã³ãReactNativeã¢ããªã±ãŒã·ã§ã³ã«è¡šç€ºãããæ å ±ã管çã§ããŸãã ããã§ã¯äž»ã«ããã³ããšã³ãéçºã«ã€ããŠèª¬æããŸããã管çè åãã¢ããªã±ãŒã·ã§ã³ã®ãµãŒããŒéšåã¯Ruby on RailsãPostgresãHerokuã«åºã¥ããŠããããšã«èšåããã®ãé©åã ãšæããŸãã
ãã®ãããžã§ã¯ãã«ã¯ããªãæ§ãããªèŠä»¶ããããŸãã ããããããã®ç²Ÿç¥ã®äœãã¯ã誰ããæ°ãããã¯ãããžãŒã»ããã䜿çšããŠéçºããããšããŠããæåã®ã¢ããªã±ãŒã·ã§ã³ã®è¯ãäŸãšåŒã¶ããšãã§ããŸãã ç§ãæçµçã«äœã«ãªã£ããã«èå³ããããªãïŒãããŠããããã©ãã ãæ£ç¢ºã«ç§ã«äŒãã£ãã®ãã«ã€ããŠã®è©±ãèªãæéãè²»ãããã©ããã決ããããšã«åæ ŒããïŒãããã«ã¢ããªã±ãŒã·ã§ã³ã®æåã®ããŒãžã§ã³ã®æŠèŠããããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®æåã®ããŒãžã§ã³
ãŸã èªãã§ããŸããïŒ ããã§ã¯ã次ã«é²ã¿ãŸãããã
æé«ããåŠã¶
åã ã¡ã«å®¶ã建ãŠãããšãçŽæãããšæ³åããŠãã ããã ããããããªãã¯ãããè¡ãæ¹æ³ãããããŸããã ããªãã¯æ¬åœã«ã©ãããå§ããã°ããã®ãããç¥ããŸããã ãã®ãããªç¶æ³ã§æåã«äœããã¹ãã§ããïŒ çãã¯æããã§ãã家ã建ãŠã圌ããåŠã¶ããšãã§ãã人ãèŠã€ããŠãã ããã
å®éã®ãšãããããã¯ãŸãã«ç§ãããããšããããšã§ãã ãããŠãç§ã¯ããªããå¿ èŠãšãããã®ãæ£ç¢ºã«èŠã€ããããšãã§ããŠãšãŠã幞éã§ããã ãã®ãããReact Nativeã®ãã¬ãŒãã³ã°è³æãæ°æéæ€çŽ¢ããã ãã§ãYouTubeã§13éšæ§æã®ããŒããŒãReact Native ãããªã³ãŒã¹ãèŠã€ããŸããã 90ã120åéç¶ãåè¬çŸ©ã¯ãåå¥ã®ãããã¯ã«å°å¿µããŸããã ãã®çµæãçŽ23æéã®é«å質ã®ãã¬ãŒãã³ã°è³æã«çŽé¢ããŸããã
ãã®ã³ãŒã¹ãèŠã€ããŠãç§ã¯ããã«ãåãã€ããã人ã®ããã«ãå匷ãå§ããŸããã ãã®çµæãå€æ¹ãšé±æ«ãéããããšãã§ããæ°é±éã®ã¯ã©ã¹ã®åŸããã®ã³ãŒã¹ãçµäºããã¢ããªã±ãŒã·ã§ã³ã®åªããåºç€ãäœæããŸããã
ä»ãç§ã¯ãã®ã³ãŒã¹ãééããªãç§ãèŠã€ããæé«ã®ãã®ã§ãããšèšãããšãã§ããŸãã ãã¡ãããç°¡æœã§ããæºåãããã¯ã©ã¹ã¯ãåŠæ ¡ã§éåžžã«ååããªåœ¹å²ãæãããŸããããå çã®ã¹ãã«ã«æ³šç®ãããããããŸããã ãããã®ã¯ã©ã¹ãå®æœããã¹ã¿ã€ã«ããã¹ããŒãã極端ãªå®çšæ§ããã©ãŒã«ã¹ãšããèšèã§èª¬æããŸãã æ°Žããç¡é¢ä¿ãªãžã§ãŒã¯ãã人çã®ç©èªããããŸããã ããªãã®è¬èãªäœ¿çšäººãããã«æžããŠãããã®ãšã¯ç°ãªã...
ãããã«ãããéåžžã«å€ãã®æçšãªæ å ±ãåè¬çŸ©ã«è©°ã蟌ãŸããä»ã®å€ãã®æåž«ã«ãããæ瀺ããã®ã«2åã®æéãããããšããæãããããŸããã èšãæããã°ããã®ã³ãŒã¹ã¯ãæåãªããŒããŒãCS50ã«éåžžã«äŒŒãŠããŸãã
ãã®ãããæåã®React Nativeã¢ããªã±ãŒã·ã§ã³ã®è¶³ããããèŠã€ãããå Žåã¯ããã®ã³ãŒã¹ããå§ãããŸãã ããã§ã¯1ã€ã®æ©èœã«æ³šæããå¿ èŠããããŸãã ãã®ã³ãŒã¹ã§ã¯ExpoããŒã«ãããã䜿çšããŸãã ããã¯ãã»ãšãã©ã®åçŽãªã¢ããªã±ãŒã·ã§ã³ã«é©ããåªããããŒã«ã§ãããã¢ãã€ã«ãã©ãããã©ãŒã ã§ã®äœæ¥ã«é¢ããããããçš®é¡ã®åŸ®åŠããåŒãåããŸãã ããããç§ãšåãããã«ããããžã§ã¯ãã®åºç€ãäœæãããå Žåã¯ãé ããæ©ãããããªã倧ããè€éãªã¢ããªã±ãŒã·ã§ã³ã«ãªããåæã«ãã¢ã¯ã·ã§ã³ã®å®å šãªèªç±ãå¿ èŠãªå Žåã¯ãããããReact Nativeã
ç§ã䜿çšã§ãã2çªç®ã®ããã¬ãŒãã³ã°ãªãœãŒã¹ãã¯ãååã§ããããšãå€æããŸããã 幞éãªããšã«ãç§ãåããŠããäŒç€ŸãReact Nativeãããžã§ã¯ãã®éçºãå§ããŸããã ç§èªèº«ã¯ãã®ãããžã§ã¯ãã«é¢äžããŠããŸããã§ããããå€ãã®ããšãåŠã³ãŸããããã®ãããžã§ã¯ãã«æºãã£ã人ã ãšè©±ãããŠãã³ãŒããåæããã ãã§ãã
React Nativeã¢ããªã±ãŒã·ã§ã³ã®éçºã«é¢é£ãããã¹ãŠã説æããã®ã§ãæè¡çãªåé¡ã«ç§»ããŸãããã
éçºç°å¢
react-native init MyApp
ãšãã圢åŒã®ããŒã ã䜿çšããåŸãã¢ããªã±ãŒã·ã§ã³ã®åºç€ãäœæããŸãããæåã«çŽé¢ããã¿ã¹ã¯ã®1ã€ã¯ãæ°ããéçºç°å¢ã®éçºã§ããã
éåžžã®WebéçºããReact Native-environmentã«ã¢ã¯ã»ã¹ããå Žåã¯ãããã§èª¬æããå 容ã®å€ããããªãã¿ã®ããã«èŠããããšã«æ³šæããŠãã ããã ç§ã«ãšã£ãŠããã¯ãAtomãã³ãŒããšãã£ã¿ãŒãšããŠãiTermãã¿ãŒããã«ãšããŠãGitUpãgitãæäœããããã®ã€ã³ã¿ãŒãã§ã€ã¹ãšããŠäœ¿çšãç¶ããããšãæå³ããŠããŸããã ïŒä»Vimãã¡ã³ããããèªãã§ãããªãã誰ããçŽåŸããŠããªãããšããå§ãããŸããïŒããããäžèšã®ããŒã«ã«å ããŠãReact Nativeã¢ããªã±ãŒã·ã§ã³ãéçºããããã«äœãä»ã®ãã®ãå¿ èŠã§ããã
ããšãã°ãiOSãšãã¥ã¬ãŒã¿ãŒã«æ £ããå¿ èŠããããŸããã
react-native run-ios
ã³ãã³ãã®ã³ãã³ãã©ã€ã³ã«ããå®è¡ã¯äžèŠã·ã³ãã«ã«èŠããŸãããäœæ¥ã®æåã®æ®µéã§ã¯ããã®ã³ãã³ããåŒã³åºãã ãã§ã¯ãšãã¥ã¬ãŒã¿ãŒãæ£åžžã«æ©èœããŸããã§ããã æ°ããnpmããã±ãŒãžãã»ãŒæ¯æ¥ãããžã§ã¯ãã«è¿œå ãããããïŒãããŠåŸã«ãããªãã®æ°ã®ãã€ãã£ãCocoaPodã¢ãžã¥ãŒã«ïŒãç§ã¯æã¿ããããã£ãšè¿ããWatchmanãªãœãŒã¹ãšHasteãã£ãã·ã¥ãã¯ãªã¢ããnode_modulesãã©ã«ããŒãåé€ãããšããäžå¿«ãªååŒã«æ £ããããšãäœåãªããããŸããã¢ãžã¥ãŒã«ãåã€ã³ã¹ããŒã«ããMetro Bundlerãã£ãã·ã¥ããªã»ããããŸãã 幞ããªããšã«ããããã®ã¿ã¹ã¯ã¯ãã¹ãŠæ¬¡ã®ã³ãã³ãã§è§£æ±ºã§ããŸãã
watchman watch-del-all && rm -rf tmp/haste-map-react-native-packager && rm -rf node_modules && yarn && npm start --reset-cache
10件äž9件ã®ã±ãŒã¹ã§ããã®ãããªãã¿ã³ããªã³ãšã®ãã³ã¹ãã«ããããšãã¥ã¬ãŒã¿ã¯åŸ©æŽ»ããŸããã ããããæã«ã¯ããã§ããååã§ã¯ãããŸããã§ããã 次ã«ãGitHubã®ãšã©ãŒã¡ãã»ãŒãžã®èª¬æã詳ãã調ã¹ãStackOverflowã®èª¬æãèªãå¿ èŠããããŸããã
ä»ã®ããã€ãã®åé¡ã®åå ã¯ãé·ãéãããã€ãã®åé¡ã解決ããããã«Xcodeãå®è¡ããå¿ èŠããããšæã£ãŠãããšããäºå®ã§ããã ãããŠãç§ãä¿¡ããŠãããªãã¯ãã®ãã©ãŒããŠã¹IDEã«ã§ããã ãçãæéæ»åšããããåªããŸãã
åæ§ã®è©±ã¯ãç¹å®ã®ããŒãžã§ã³ã®iPhoneã§ãšãã¥ã¬ãŒã¿ãŒãèµ·åããããšã§ãã 以äžã®ã³ãã³ããã³ãã³ãã©ã€ã³ãããã®åé¡ãçŽæ¥è§£æ±ºãããšä»¥åã«èª°ããç§ã«èšã£ãŠãããªããReactéçºã®æåã®æ°ã¶æã¯å°ã楜ã ã£ãã§ãããã
react-native run-ios --simulator='iPhone X'
æ°ããéçºç°å¢ã«æ £ããé£ããã®ä»ã®äŸã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ãªãªãŒã¹ããŒãžã§ã³ãæºåãã3段éã®ããã»ã¹ ïŒApp StoreãŸãã¯Visual Studio App CenterãFirebaseãªã©ã®ç¶ç¶ççµ±åç°å¢ã«é 眮ããããïŒããã³ãªãªãŒã¹ããŒãžã§ã³ããããŒãžã§ã³ãžã®ç§»è¡ããã»ã¹ãå«ãŸããŸãã ïŒéçºã¢ãŒããžã®ïŒãããã°ãç®çãšããŠããŸãã ããããå€ãã®äººã¯ããããžã§ã¯ãã«å¿ èŠãªå€æŽãä»»æã®ããã¹ããšãã£ã¿ãŒã䜿çšããŠè¡ãããšãã§ããããšãæããã«ããã§ãããã ãããã«ãããããã¯éçºã¢ãŒãã§äœæ¥ãããšãã«ã¯ãŒã¯ãããŒã«äºæ³å€ã«å€§ããªåœ±é¿ãäžããããã€ãã®å°ããªããšã®ã»ãã®äžäŸã§ãã
ãããŠæåŸã«ãWebã¢ããªã±ãŒã·ã§ã³ãéçºãããšãã«éåžžChromeã ãã䜿çšããŠè§£æ±ºããã¿ã¹ã¯ã解決ããããã«å¿ èŠãªããŸããŸãªmacOSã¢ããªã±ãŒã·ã§ã³ã絶ããåãæ¿ããå¿ èŠã«æ £ããã®ã«æéãããããŸããã
JavaScriptã³ãŒããã³ã³ãœãŒã«ã«æžã蟌ãã§ããå 容ã確èªãããããã°ã®ããã«HTML / CSSåºåãåæããããã«ã React Native Debuggerã䜿çšããŸãã ã ã¢ããªã±ãŒã·ã§ã³ã®ç¶æ ãéä¿¡ãããã¢ã¯ã·ã§ã³ãAPIãªã¯ãšã¹ããåä¿¡ããå¿çãç£èŠããããã«ã Reactotronã䜿çšããŸãã ã ãããã®ã¢ããªã±ãŒã·ã§ã³ã®äž¡æ¹ãéåžžã«æçšã§ããããšãããããŸããããã¢ããªã±ãŒã·ã§ã³ãå®è¡ãããåãç°å¢ã§ãã¹ãŠã®ãããã®ã¿ã¹ã¯ã解決ã§ããå Žåããã©ã°ã€ã³ã䜿çšããŠãEmber.jsã¢ããªã±ãŒã·ã§ã³ãäœæããããã«äœ¿çšãããç§ã®éåžžã®ã¯ãŒã¯ãããŒã«ã€ããŠèããããšã¯é¿ããããŸããChromeã®Ember InspectorïŒã
ããã²ãŒã·ã§ã³
ããã²ãŒã·ã§ã³/ã«ãŒãã£ã³ã°ã®æŽçã¯ãReact Nativeã«ãšã£ãŠéåžžã«é£ããã¿ã¹ã¯ã®ããã§ãã ãã®ãã¬ãŒã ã¯ãŒã¯ã®ååšäžã«ããã®åé¡ã«å¯Ÿããå€ãã®ç°ãªã解決çãç»å ŽããŸããããæ®éçã«èªèãããŠããæšæºãšåŒã¶ããšãã§ãããã®ã¯ãŸã ãããŸããã åå¿ããã²ãŒã·ã§ã³ã©ã€ãã©ãªã䜿çšããããšã«ããŸãããç§ã®éžæã¯äž»ã«ãç§ãçµéšããReact Nativeã³ãŒã¹ã§ãã®ã©ã€ãã©ãªã«ã€ããŠè©±ãããšããäºå®ãšãååã䜿çšãããšããäºå®ã«åœ±é¿ãããŸããã
ãã®åé¡ã®ååãªèª¿æ»ã«æéãè²»ãããå Žåã次ã®ããšãããããŸããã
- åå¿ããã²ãŒã·ã§ã³ãããžã§ã¯ãã«ã¯ãGitHubã«çŽ15,000åã®æãããã86åã®æªè§£æ±ºã®åé¡ããããŸãã ããã¯å®å šã«JavaScriptã«åºã¥ããŠãããç§ãèŠãããã²ãŒã·ã§ã³ãœãªã¥ãŒã·ã§ã³ã®äžã§æã詳现ãªããã¥ã¡ã³ããåããŠããŸãã
- react-native-navigationã©ã€ãã©ãªãŒã¯çŽ10,000åã®æãç²åŸãã162åã®æªè§£æ±ºã®åé¡ãããããšãå€æããŸããã ãã ããJavaScriptã ãã§ã¯ãããŸããã ããã䜿çšããã«ã¯ããã€ãã£ããã¡ã€ã«ãç·šéããå¿ èŠããããŸãã
- react-routerãªããžããªã«ã¯ãçŽ35,000ã®æãšGitHubã®55ã®æªè§£æ±ºã®åé¡ã®ãªã¹ãããããŸãã 確ãã«ããã®ãªããžããªã«ã¯ãReact Nativeã ãã§ãªãReactåãã«èšèšãããããã±ãŒãžãå«ãŸããŠãããããããã§èª¬æããä»ã®ãããžã§ã¯ããšçŽæ¥æ¯èŒããããšã¯ã§ããŸããã
- ãã€ãã£ãããã²ãŒã·ã§ã³ãããžã§ã¯ãã«ã¯ãçŽ3,000ã®æãš55ã®æªè§£æ±ºã®åé¡ããããŸãã ãããå匷ããŠäœ¿çšãã人ã¯ããŸã ããŒã¿çã§ãããJavaScriptã ãã§ãªãAirbnbã«ãã£ãŠãµããŒããããŠããããšãèæ ®ããå¿ èŠããããŸãïŒãã®äŒç€Ÿã¯ React Native ãæŸæ£ããããšã«ããŸãã ïŒ
ããããäžèšãèæ ®ããŠããããšãã°ã ãã®ã¬ããŒãã®èè ãè¡ã£ãããã«ãããããã¹ãŠã®ã©ã€ãã©ãªãè©Šãæéããªãããããšã«ããåå¿ããã²ãŒã·ã§ã³ãéžæããã§ãããã ãããŠæåŸã«ããã®ã¬ããŒãã§è¿°ã¹ãããã«ãããã²ãŒã·ã§ã³ãæŽçããããã®ããŒã«ã®éžæã¯ããœãªã¥ãŒã·ã§ã³ããããã®ããŒã«ã®ã©ããæè¯ãšåŒã¶ããšãã§ãããã«ã¯äŸåããŸãããããããã®ã©ããç¹å®ã®ãããžã§ã¯ãã®ããŒãºã«æé©ã§ãããã«äŸåããŸãã
çŽ9ãæéãåå¿ããã²ãŒã·ã§ã³ãæäœããåŸãç§ã¯æ¬åœã«æå¥ãèšãå¿ èŠã¯ãªããšèšãå¿ èŠããããŸãã ãã®ã©ã€ãã©ãªãEmber.jsã§äœ¿çšãããŠãã䜿ãæ £ããrouter.jsã©ã€ãã©ãªãšæ¯èŒãããšãããã¯ãŸã£ããæ°ãããã®ã§ãããšèšããŸãã
åå¿ããã²ãŒã·ã§ã³ããã²ãŒã·ã§ã³ããŒã«ã®3ã€ã®äž»èŠãªã¿ã€ããæ±ãã®ã¯æ¬åœã«ç°¡åã§ããã ãããã¯
StackNavigator
ã
TabNavigator
ããã³
DrawerNavigator
ã§ãã ãããã®ããŒã«ãçµã¿åãããŠãå¿ èŠãªã¢ããªã±ãŒã·ã§ã³ããã²ãŒã·ã§ã³ã·ã¹ãã ãäœæããæ¹æ³ãç解ããããšã¯ãã¯ããã«å°é£ã§ããã
ããšãã°ã
DrawerNavigator
ã³ã³ããŒãã³ããããã²ãŒã·ã§ã³ã·ã¹ãã ã®ã«ãŒãèŠçŽ ïŒã¡ã€ã³ã®
TabNavigation
ã³ã³ããŒãã³ãã®1ã€äžã®ã¹ãããïŒã«ããå¿ èŠããããšããäºå®ã¯ã
DrawerNavigator
ã¯
DrawerNavigator
ã¯ãããŸããã§ããã æ³åãã«ããå Žåãããã
DrawerNavigator
åäœã®
DrawerNavigator
ã§ãïŒå®éã®ã¢ããªã±ãŒã·ã§ã³ã§ã¯ããã¹ãŠãããã¹ã ãŒãºã«æ©èœããŸãïŒã
åäœäžã®åå¿ããã²ãŒã·ã§ã³ããã®DrawerNavigator
ã芧ã®ãšãããã¢ããªã±ãŒã·ã§ã³ç»é¢ã§ã¹ã¯ã€ãããŠãµã€ãããã²ãŒã·ã§ã³ããŒãéãå¿ èŠããããŸããã
ãµã€ãããŒã¯ãã¢ããªã±ãŒã·ã§ã³ã®äžéšã«ããã¡ã€ã³ããã²ãŒã·ã§ã³ããŒãšæ¯èŒããŠãäºæ¬¡çãªãã®ã ãšæããŸããã ãããã£ãŠã DrawerNavigatorã¯ã¡ã€ã³ã®BottomTabNavigatorã®äžããŸãã¯ãã®èŠçŽ ãšåãã¬ãã«ã®ã«ãŒãããªãŒïŒäžã«è¡šç€ºïŒã«é 眮ããå¿ èŠãããããã«æãããŸããã
ããããããªãèŠããã§ãåãŸããªã
DrawerNavigator
ãµã€ãããã«ã匷å¶çã«æŒã蟌ãããšãããšãåå¿ããã²ãŒã·ã§ã³ã®æ©èœã«å¿ããŠã
DrawerNavigator
1ã¹ãããäžã
BottomTabNavigator
ããã²ãŒã·ã§ã³ããªãŒã®ã«ãŒãã ç§ã®ãã®çºèŠãããã®è³æã®èªè ã®1人ãGitHubã®è³æãè³æãèªãã®ã«è²»ããæéãç¯çŽããã®ã«åœ¹ç«ã€ããšãé¡ã£ãŠããŸãã
ã¢ããªã®ããã²ãŒã·ã§ã³ããªãŒã¯æ¬¡ã®ããã«ãªããŸãã ããã§ã¯ãã«ãŒãèŠçŽ ãšããŠ
MainDraverNavigation
䜿çšãããŸãã
ã¢ããªã±ãŒã·ã§ã³ã®æåã®ããŒãžã§ã³ã®æçµããã²ãŒã·ã§ã³ããªãŒ
ããã§ãã³ãã¥ããã£ã»ã¯ã·ã§ã³ãšäŒè°ã»ã¯ã·ã§ã³ã«
StackNavigator
ãš
TabNavigator
äž¡æ¹ãå¿ èŠãªçç±ãçåã«æããããããŸããã
StackNavigator
ã¬ã€ã€ãŒãããããããŠ
TabNavigator
ã«çŽæ¥é²ãããšã¯ã§ããŸãããïŒ
åé¡ã¯ã2ã€ã®
TabNavigator
èŠçŽ ã®ããããã«ã¿ã€ãã«ã
TabNavigator
å¿ èŠããããšããããšã§ãã ããã«ãããŸãã
TabNavigatorãã¿ã€ãã«
ããã§ããç§ã®æšæž¬ã¯åå¿ããã²ãŒã·ã§ã³ããã€ã¹ãšäžèŽããŸããã§ããã MaterialTopTabNavigatorã¯å®å šã«éåžžã®ããã²ãŒã·ã§ã³ã³ã³ããŒãã³ãã§ãããšèããã®ã§ãã¿ã€ãã«ãèšå®ã§ãããã«ãã€ã³ãªãã·ã§ã³ãèšå®ã«å«ããå¿ èŠããããšå€æããŸããã
StackNavigator
ããã®çš®ã®ãã®ã¯ãããŸããã§ããããã®ããã
StackNavigator
ãäžéå±€ãšããŠäœ¿çšããããšãäœåãªããããŸããããã®çµæãã¢ããªã±ãŒã·ã§ã³ã€ã³ãã©ã¹ãã©ã¯ãã£ã«è€éããè¿œå ããããªããå粧åãã®èæ ®äºé ã«å°ãããŸããã
ããã«ãåå¿ããã²ãŒã·ã§ã³ã®ãã®æ¬ åŠã¯ãç§ã«ãã£ãšæ·±å»ãªåé¡ãåŒãèµ·ãããŸããã ç¹ã«ããŠãŒã¶ãŒãFlatListã§æŽçãããèŠçŽ ã®ãªã¹ããã¹ã¯ããŒã«ããŠããéã«ãããããŒç»åã®æãããã¿ãšæ¶å€±ãæŽçããå¿ èŠããããŸãã ã [ããŒã ]ã»ã¯ã·ã§ã³ãš[éžæ]ã»ã¯ã·ã§ã³ã®ã¿ã€ãã«ã¯ããããã®èŠçŽ ã®ãªã¹ããšåã
StackNavigator
å ã«è¡šç€ºãããããããªã¹ãã®æ®ãã®éšåãšäžç·ã«ã¿ã€ãã«ãã¹ã¯ããŒã«ãããã ãã§ãã®åé¡ã解決ããããšã¯é£ãããããŸããã
ããããã³ãã¥ããã£ãšäŒè°ã®ã»ã¯ã·ã§ã³ã®å ŽåãããããŒã
StackNavigator
èŠçŽ ã䜿çšããŠ
StackNavigator
ããããªã¹ããããã²ãŒã·ã§ã³ããªãŒã®1ã€äžã®
StackNavigator
èŠçŽ ã䜿çšããŠè¡šç€ºããããããåããœãªã¥ãŒã·ã§ã³ãé©çšããæ¹æ³ãèŠã€ãããŸããã§ããã ãã®çµæãã¿ã€ãã«ã®ã¹ã¯ããŒã«ãæåŠããŸãããããã«ãããã¢ããªã±ãŒã·ã§ã³ã«äžåäžãªäžåäžæ§ãçããŸããã
TabNavigatorããã³StackNavigatorã§ã®ã¹ã¯ããŒã«
Iphone Xãã·ãã¥ã¬ãŒããããšãã¥ã¬ãŒã¿ãŒã§ã¯ãèŠåºãã«é¢ããäžèšã®åé¡ã¯æ·±å»ã§ãããå°ããªç»é¢ã«ã¯è¡šç€ºãããªãããã§ãããã¿ã€ãã«ã¯äœ¿çšå¯èœãªç»é¢ã¹ããŒã¹ã®çŽ20ïŒ ãå ããå¯èœæ§ããããŸãã 誰ãããã®åé¡ã解決ããæ¹æ³ãç¥ã£ãŠãããªããç§ã«ç¥ãããŠãã ããã
TabNavigator
ã®åãåé¡ã¯ãDestinationã»ã¯ã·ã§ã³ã§ãæããããŸããã 次ã®å³ã«ç€ºãããã«ãå³åŽã®[ã³ã¯ãŒãã³ã°ã¹ããŒã¹]ã¿ãã«å¥ã®
TabNavigator
èŠçŽ ãé 眮ããŠã[æ å ±]ã[ã¡ã³ããŒ]ãããã³[é£çµ¡å ]ã®3ã€ã®ã¿ãã衚瀺ããŸãã
TabNavigator
䜿çšããå Žåã決å®ãè€éã«ããããšãªããèŠçŽ ã®äžéšã«ã¹ã©ã€ãã·ã§ãŒãé 眮ããããšã¯é£ãããããã²ãŒã·ã§ã³ïŒäž»ã«ããã²ãŒã·ã§ã³ãªãã·ã§ã³ã«é¢é£ããïŒã§å€ãã®åé¡ãåŒãèµ·ããããšã¯ãããŸããã§ããã ãã®ãããããã3ã€ã®ã¿ããæäœããã«ã¯ã react-native-swiperãšããJSããã±ãŒãžã«é Œããªããã°ãªããŸããã§ããã ã¢ããªã±ãŒã·ã§ã³ãã¿ãããããŒã匷調ããè¡ã®çªç¶ã®ã¢ãã¡ãŒã·ã§ã³ã«ã€ãªãããªãå Žåããã®ãœãªã¥ãŒã·ã§ã³ã¯ç§ã«å®å šã«é©ããŠããããšã«æ³šæããŠãã ããã ãããã«ãããç§ã¯ãã®æ¬ ç¹ãã代æ¿ããã²ãŒã·ã§ã³ã·ã¹ãã ã®åé¡ãåé¿ããæ©äŒã«å¯Ÿããå ¬å¹³ãªæ¯æãã§ãããšèããŸããã
react-navigationã®TabNavigatorãšreact-native-swiperãæ¯èŒããŸãïŒã¿ãåã®äžã®éè²ã®ç·ã®ã¢ãã¡ãŒã·ã§ã³ã®éãã«æ³šæããŠãã ããïŒ
ã¢ããªã±ãŒã·ã§ã³ããã²ãŒã·ã§ã³ãµãã·ã¹ãã ãå®è£ ããåŸã«ç§ãäžããçµè«ã¯æ¬¡ã®ãšããã§ãã
- React Nativeã¢ããªã±ãŒã·ã§ã³ã§ããã²ãŒã·ã§ã³ãæŽçããããã®å€ãã®ææžåããããœãªã¥ãŒã·ã§ã³ããããŸããããã®äžã§ç§ã¯åå¿ããã²ãŒã·ã§ã³ãéžæããŸããã ç§ã®ããŒãºã«æé©ã§ãã
- éçºè ãã¢ãã€ã«ãã©ãããã©ãŒã ã®ããã²ãŒã·ã§ã³ã·ã¹ãã ãã©ã®ããã«æ©èœããããããŸãç¥ããªãå Žåãåå¿ããã²ãŒã·ã§ã³ã©ã€ãã©ãªã¯ãããžã§ã¯ãã®äœæ¥ã®éå§ãå€§å¹ ã«ç°¡çŽ åããŸãã
- åå¿ããã²ãŒã·ã§ã³ã©ã€ãã©ãªã«ã¯ïŒå°ãªããšãWebéçºè ã«ãšã£ãŠïŒçŽæçã§ã¯ãªãæ©èœãããã€ããããŸãããæãå¹ççãªæ¹æ³ã§ã¯ãããŸããããåé¿ã§ããªããã®ã¯ãããŸããã
ã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³
react-native init
ã³ãã³ãã䜿çšããŠäœæããããšãã¥ã¬ãŒã¿ãŒã§æ°ããã¢ããªã±ãŒã·ã§ã³ãèµ·åããå€æŽãå ãããã³ã«åžžã«ãªããŒããããšãã¢ããªã±ãŒã·ã§ã³ã«çŽ æµãªã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³ãå¿ èŠã§ããããšãããã«ããããŸãïŒãã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³ããšãåŒã°ããŸãïŒã
ã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³ã®äœãæ¹ã¯ããã«ããæžãããŠããã®ã§ããã®è³æã®èè ã®èšèã¯ç¹°ãè¿ããŸããã ç§ãééããåé¡ã«ã€ããŠã®ã¿ã話ãããŸããããã®ã¬ã€ãã«ã¯äœã®åé¡ããããŸããã ãã®åé¡ã¯æ¬¡ã®ããã«ãªããŸãã
åé¡ã®ããã¹ãã©ãã·ã¥ç»é¢
ãã®åé¡ã¯iOSã§ãŸãã«çºçããŸãããã¢ããªã±ãŒã·ã§ã³ã®äžéšã®ãŠãŒã¶ãŒã¯ãããããã®åé¡ã«ééããã§ãããã ãã®åé¡ãæåã«çºèŠããã®ã¯ãWiFiã䜿çšã§ããªãå Žæã§åããŠããŠãã©ããããããé»è©±ã§4Gã€ã³ã¿ãŒãããã«æ¥ç¶ãããšãã§ãã IPhoneãŠãŒã¶ãŒã¯ãé»è©±ãã€ã³ã¿ãŒããããé ä¿¡ãããšãã¹ããŒã¿ã¹ããŒãéããªããé«ããªãããšãç¥ã£ãŠããŸãã ããã«ãããé»è©±ã§ã¢ããªã±ãŒã·ã§ã³ãèµ·åãããšãã«ãã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³ã®ç»åããå£ãããŸããã åŒã³åºãæã«åãåé¡ãçºçããŸããã
ãã®çµæã react-native-splash-screenãªããžããªãŒããã°ããæãäžããŠãããã«æçšãªãã®ãèŠã€ãããªãã£ããããã¹ãã©ãã·ã¥ã¹ã¯ãªãŒã³ã衚瀺ããªããã¹ããŒã¿ã¹ããŒãå®å šã«é衚瀺ã«ããŠãã®åé¡ãåé¿ããããšã«ããŸããã
UIStatusBarHidden
ããŒã
UIStatusBarHidden
ã«è¿œå ããŠè«çå€
true
å²ãåœãŠã
SplashScreen.hide()
åŒã³åºããåŸãReact Native
StatusBar
ã³ã³ããŒãã³ãã®
hidden
ããããã£ã
StatusBar
ã§ãã
ç¶æ 管ç
éå»2幎éãç§ã¯æ¯æ¥ãæ§æãããåæã®åªå é äœãæ§æãããæ¡çŽïŒCoCïŒã®ååã«ã€ããŠè³ã«ããŠãããšæããŠããŸãã ã ãããããã¯ç§ã®ä»¥åã®ä»äºã§ããã ãµãŒããŒã§ã¯ãRuby on Railsãšã¯ã©ã€ã¢ã³ã-Ember.js-ã®2ã€ã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããŠããããã®æ¬è³ªã¯CoCã®ååã«å®å šã«é©åããŠãããããããã¯é©ãããšã§ã¯ãããŸããã ç§ã¯ãããäœãæå³ããã®ãç¥ã£ãŠãããšæã£ãŠããŸããããReact Nativeã®ç¶æ 管çã«ã€ããŠåŠã¶ããã»ã¹ã¯ããã®ååã®ãŸã£ããæ°ããç解ãäžããŠãããŸããã
ããã€ãã®éåžžã«åçŽãªã¢ããªã±ãŒã·ã§ã³ã§ããã®åçã®åœ±é¿ãåããReactã©ã€ãã©ãªãå®éšããŸãããã ReduxãMobXãªã©ã®ç¶æ ã³ã³ãããŒã䜿çšããå©ç¹ãç解ã§ããã»ã©ååã«å€§ããªãã®ãäœæããããšã¯ãããŸããã§ãã ã JSã¢ããªã±ãŒã·ã§ã³ã®ç¶æ 管çã«ãããç§ã®çµéšã®ã»ãšãã©ã¯ã Ember Dataã«é¢é£ããŠããŸã ïŒããã¯ãç¶æ ã管çããæ°žç¶çãªããŒã¿ã¹ãã¬ãŒãžãæŽçããããã®Emberã®çµã¿èŸŒã¿ã·ã¹ãã ã§ãïŒã
Reduxã©ã€ãã©ãªã¯ãç§ãé·å¹Žã«ããã£ãŠè³ã«ããïŒãããŠç§ãæ±ã£ãReact Nativeã³ãŒã¹ã§è°è«ãããïŒç¶æ 管çã®åé¡ã«å¯Ÿããæè¯ã®ãœãªã¥ãŒã·ã§ã³ã®1ã€ã§ããããã«æããããããäžè¬ã«ã競åä»ç€Ÿã«ç®ãåããŸããã§ããã ã¢ããªã±ãŒã·ã§ã³ã«æ¢åã®æé«ã®ç¶æ 管çã·ã¹ãã ãè£ åããããŸãæéããããã«ãããå®è¡ãããã£ãã ãã§ãã
Emberã§ã¯ãããŒã¿ã€ã³ãã©ã¹ãã©ã¯ãã£ã®90ïŒ ããããã«äœ¿çšã§ããããã°ã©ããŒã®æã«æž¡ã£ãŠããŸãã ç§ã®çŸåšã®ãããžã§ã¯ãã§ã¯ããã¹ãŠããŸã£ããéã«ãªããšã¯æããŸããã§ããã å€æããããã«ãReactã ãã§ãªããæã人æ°ã®ããç¶æ 管çã©ã€ãã©ãªã§ããReduxã¯ãã°ããŒãã«ã¹ããŒã¿ã¹ã®ç¶æã«åœ¹ç«ã€ãã®ãäœãæäŸããŠããŸããã ãã®ã©ã€ãã©ãªã¯éåžžã«è»œéã§ãããããããã°ã©ãã¯ãé©åãªç¶æ 管çã·ã¹ãã ãäœæããããã«ãã¢ããªã±ãŒã·ã§ã³å ã§ããŒã¿ãæäœããããšã«ã€ããŠã®å¿é ã®90ïŒ ãè² æ ããå¿ èŠããããŸãã
ä»ãããã¯ããã«çµéšã®æµ ãéçºè ã§ããç§ãç¥ã£ãåŸãç§ã«ãšã£ãŠæãé£ããããšã¯ãæ°ããæ©èœãšå ç«ã®ååã«æ £ããããšã§ããã ãµãŒããŒããããŒã¿ãåçŽã«ããŠã³ããŒããããããµãŒããŒã«éä¿¡ãããããããã«å¿ èŠãªé©ãã»ã©å€§éã®äœæ¥ã«èããåŸããããã¯ãã¹ãŠ7ã€ã®éåžžã«ç°¡åãªã¹ãããã®åœ¢ã§ãŸãšããããŸããã
-
SOME_ACTION_REQUEST
ãSOME_ACTION_FAILED
ãSOME_ACTION_SUCCEEDED
3ã€ã®å®æ°ããã¡ã€ã«ã«è¿œå ããŸãã - ã¢ã¯ã·ã§ã³äœæè ãã¢ã¯ã·ã§ã³ãã¡ã€ã«ã«è¿œå ããŸãã
- é©åãªã¬ãã¥ãŒãµãŒã§3ã€ã®ã¢ã¯ã·ã§ã³ãåŠçããå¿ èŠã«å¿ããŠã·ã¹ãã ã«æ°ããã¬ãã¥ãŒãµãŒãè¿œå ããã«ãŒãã¬ãã¥ãŒãµãŒã«å«ããŸãã
- é©åãªãµã¬ã«ã¯ãŒã«ãŒãè¿œå ããå¿ èŠã«å¿ããŠãã·ã¹ãã ã«æ°ãããµã¬ãè¿œå ããŠã«ãŒããµã¬ã«å«ããŸãïŒç§ã¯redux-sagaã©ã€ãã©ãªã䜿çšããŠéåæã¢ã¯ã·ã§ã³ãåŠçããŸãïŒã
- å¯èœãªAPIãªã¯ãšã¹ããåŠçããé¢æ°ãè¿œå ããŸãã
- å¿ èŠãªããŒã¿ãç¶æ ãã察å¿ããReactã³ã³ããŒãã³ãã®ããããã£ã«ãããããŸãã
- 察å¿ããReactã³ã³ããŒãã³ããã
SOME_ACTION_REQUEST
ã¢ã¯ã·ã§ã³ãéä¿¡ããŸãã
Reduxãšredux-sagaã«ã¯ãã¡ãããã¯ããã«åºç¯ãªæ©èœããããŸãããç§ãçŸåšèå³ãæã£ãŠããããšãèãããšãäžèšã®7ã€ã®ã¹ãããã¯Reduxã«ãšã£ãŠç§ã«ãšã£ãŠã®ãã®ã§ãã
ã»ãã·ã§ã³
ãã®ãããReact Nativeã¢ããªã±ãŒã·ã§ã³ã®éçºç°å¢ãã»ããã¢ããããããã²ãŒã·ã§ã³ããªãŒãäœæããç¶æ 管çã€ã³ãã©ã¹ãã©ã¯ãã£ãæºåããŸããã ãããžã§ã¯ãã®æ¬¡ã®ã¹ãããã§äœãããã®ãè¯ãã§ããããïŒ ç§ã«ãšã£ãŠããŠãŒã¶ãŒèªèšŒã·ã¹ãã ã®äœæã¯ããã®è³ªåã«å¯ŸãããŸã£ããèªç¶ãªçãã§ããã ããã§ã¯ãã»ãã·ã§ã³ã«ã€ããŠã話ããŸãã
WebéçºããReact Nativeã®åéã蚪ããå Žåã¯ãããã»ã©å°é£ãªãã»ãã·ã§ã³ã«å¯ŸåŠã§ããŸãã LocalStorageã¹ãã¬ãŒãžã®åºã«ãªã£ãŠããæŠå¿µã«å°ãã§ã粟éããŠããå ŽåãReact Nativeã䜿çšããå Žåããã®ãããªã¹ãã¬ãŒãžãžã®ã¢ã¯ã»ã¹ã¯AsyncStorageã®åŒã³åºãã«çœ®ãæããå¿ èŠãããããšã ããç¥ã£ãŠããå¿ èŠããããŸãã ããã¯ãã»ãã·ã§ã³éã§ããŒå€åœ¢åŒã§ããŒã¿ãä¿åã§ããæœè±¡åã¬ãã«ã§ãã ã€ãŸããããã§ã¯ããµãŒããŒã§çæããããŠãŒã¶ãŒãã·ã¹ãã ã«æ£åžžã«ãã°ã€ã³ããåŸã«ã¯ã©ã€ã¢ã³ãã«éä¿¡ãããèªèšŒããŒã¯ã³ãä¿åã§ããŸãã
ãªã¹ã
ãªã¹ãã®æäœã«ã€ããŠè©±ããšãReact Nativeã§ãã®åé¡ã¯éåžžã«ãã解決ãããšæããŸããã äžè¬ã«ãéçºè ã«ã¯3ã€ã®å¯èœæ§ãããããšã«æ³šæã§ããŸãã 衚瀺ãããããŒã¿ãå€åããªãéçãªã¹ãã§æ©èœããå Žåã ScrollViewã¯ããããããã§ååã§ãã , , , , FlatList . , , , , SectionList .
, ,
FlatList
. , , , , , . .
â
FlatList
,
refreshControl
. , , , , . , React Native , . â RefreshControl . , .
RefreshControl
, , ,
refreshControl
,
RefreshControl
, , . , , :
- , , . ,
handleRefresh()
. - , , « » ( ).
â .
, , , , . , , , GitHub.
,
refreshControl
onEndReached
( )
fetching
. , - ,
false
true
, â , , 250 ,
RefreshControl
, .
,
setTimeout()
fetching
350 . . , ,
setTimeout
â , ,
handleRefresh()
handleLoadMore()
â
refreshing
loadingMore
. , , , , - .
,
onRefresh
refreshing
refreshControl
. ,
refreshControl
, , , , .
â
, . â , , Load More , , , , .
FlatList. , , 2, onEndReached , 2-
,
onEndReached
. .
onEndReachedThreshold
,
FlatList
, ,
onEndReached
. .
100 , , 10 , 1,
onEndReachedThreshold
, ,
onEndReached
, , 90-. 2, , 2- , â 80- , .
, , , ,
FlatList
. , , , ,
handleLoadMore()
,
onEndReached
, , â 10 .
, ,
loadingMore
, ,
handleLoadMore()
, , ,
!loadingMore
. , , .
â
ListLoadingComponent
FlatList
, ,
ListHeaderComponent
,
ListEmptyComponent
ListFooterComponent
, , - , , , .
,
render()
.
â
, , , . , , .
,
scrollToOffset
FlatList
, , . , .
ref
FlatList
:
<FlatList ref={(ref) => { this.newsListRef = ref; }} ... />
, .
ScrollToOffset
handleScrollToTop()
, , , react-navigation, , :
componentDidMount() { this.props.navigation.setParams({ scrollToTop: this.handleScrollToTop, }); } handleScrollToTop = () => { this.newsListRef.ScrollToOffset({ x: 0, y: 0, animated: true, }); };
, react-navigation 3
ref
,
BottomTabNavigator
.
, , . , , 4G- ( , , 3G), , , , , .
, , , , , , , . . , , , , .
, , . 7 ,
image
, , ( , ).
â
, , . react-native-image-picker , Cloudinary Carrierwawe Rails-.
, Node-API Cloudinary react-native-fetch-blob . , , , , , .
, , react-native-fetch-blob, . , react-native-fetch-blob , API JS FormData . , react-native-fetch-blob rn-fetch-blob , .
â
, React Native Image
style
,
source
resizeMode
. , , - , , , .
, , , . , , , . . Avatar react-native-elements.
,
Image
. , - , .
, , . .
react-native-slideshow
react-native-slideshow , , . , , , , , , .
â
7 , , . , â , , . , - . .
, , -, , , , - ( â ), , , , Facebook . , .
, , React Native-. , . â react-native-loading-placeholder , , , . â react-native-linear-gradient , . , , , , , , , , .
react-native-loading-placeholder react-native-linear-gradient
â
â . , React Native
Image
. , -
CachedImage
react-native-cached-image .
npm-
Image
, , ,
CachedImage
. Reactotron , , .
, , , . , , Cloudinary, 95% , , 4%. .
, .
CachedImage
activityIndicatorProps={{ animating: false }}
, .
â
React Native - Picker . - , ( - ), JS-, . , react-native-picker-select ,
<select>
iOS Android .
JS-, React Native- ( lodash , ), , , , . , , - . , .
â
react-native-calendars Wix. :
- iOS , . , , , -, â .
- React Native â
DatePickerIOS
DatePickerAndroid
, , . - , , , Apple Google.
, . , , â .
react-native-calendars react-native-picker-select
â
â , .
SaaS-, . SOAP, API Conference. , , , , .
, , , 5 . - , JavaScript Date UTC, , . , , , , , - . « », â .
, , moment-js , React Native, timezone , :
const timeSthlmAfterFive = moment().isAfter(moment.tz('17:00:00', 'HH:mm:ss', 'Europe/Stockholm'), 'second');
, , , . React Native -, , , , , ,
font-face
CSS.
. , . , 10 -. react-native-vector-icons .
, ,
CI/CD, DevOps- -, .
( ) , - . , . GitHub- . , :
- . , , .
- , - , , .
. , , , , , , push-. , , , , .
Visual Studio App Center (VSAC). Chain React 2017 . , , , DevOps-, . , , , , push-, Codepush . -. , , , , iOS, Android. , - , , , , , - .
Visual Studio App Center ( )
« », â , . , (API â ). , , , , -, (, , ).
ããã¯ã©ã®ããã«å¯èœã§ããïŒ Microsoft, , VSAC « ». , , Codepush ( React Native-) HockeyApp ( ), - . , «developers, developers, developers, developers» .
, VSAC , - Fastlane , BuddyBuild Firebase ? , , , VSAC , , , . , , ? , VSAC, , .
VSAC. , , , .
, , , VSAC Apple Developers (Apple, , , ). , , , .
, VSAC, , , CI/CD- .
Android
, iOS- , Android . Android Studio Android React Native Platform . ,
Platform.select()
. - , , ,
Platform.OS
.
, , Google Play , App Store. ãªãã§ïŒ , App Store Apple.
Apple
, -, React Native, . , Apple. , , , , , .
Apple
, â « ». -, , iOS-, , , , .
â Apple. , , , . Dun & Bradstreet, Apple, . , , , Apple (, , Apple , â ).
, Apple , , â , -. . , â ?
, .
, , Apple Developer . .
. . provisioning-, iOS-, , Apple .p12 push-, dSym-. , , , .
Apple, 50% 24 , 90% â 48 . , , â , , Apple-.
, . «Metadata Rejected». , - . , 5 ( App Store Review Guidelines ), .
, , , â . , , , , , . , â , () .
iOS, . , , , . , , . . , , .
ãŸãšã
, React Native- . React Native-. -. , : . .
, , , , . , , â , .
, - , . . , , , 8 . . .
, . , , - .
, , , 6-7 , . , , , :
- , (iOS Android), , , .
- JavaScript. , , Ember.js.
- React.js, , React-, . , JS-/.
- , Redux.
- DevOps .
- , .
- UI/UX.
- , , , , , , , , .
JS- , Flutter , NativeScript , Objective-C, Swift, Java Kotlin, React Native .
, -, , React Native , , , . , React Native â , . React Native .
芪æãªãèªè ïŒ ?