- å ¬å¼ã¢ãã¦ã³ã¹
- ã¦ã¼ã¶ã¼ã®å£°
- React Nativeã£ã½ã
- 2ã¤ã®äºå®ã確èªãã
- ææ³ã¨éªæ¨
- ãããã«
æ¬æ¥ãUber Eatsã§å¤§è¦æ¨¡é害ãããã¾ãããReact Native絡ã¿ã®ãããªã®ã§ãä»ããã£ã¦ããç¯å²ã®äºå®ã ãã¡ã¢ãã¦ãããã¨æãã¾ãã
å ¬å¼ã¢ãã¦ã³ã¹
ãã·ã¹ãã é害ã«é¢ãããç¥ããã
— Uber Eats Japanï¼ã¦ã¼ãã¼ã¤ã¼ãï¼ (@UberEats_JP) 2020å¹´1æ16æ¥
ç¾å¨ãUber Eatsã¢ããªã®ã·ã¹ãã é害ã®çºããµã¼ãã¹ãä¸æåæ¢ãã¦ããã¾ãã
ãè¿·æãããããã¾ããã復æ§ã¾ã§ãã°ãããå¾ ã¡ãã ããã
ããµã¼ãã¹åéã®ãç¥ããã
— Uber Eats Japanï¼ã¦ã¼ãã¼ã¤ã¼ãï¼ (@UberEats_JP) 2020å¹´1æ16æ¥
ãµã¼ãã¹ãåéãããã¾ããã
ã注æã«å½±é¿ã®ãã£ã注æè ã®çæ§ã«ã¯åå¥ã«ã¡ã¼ã«ã«ã¦ãé£çµ¡è´ãã¾ãã
Uber Eats ã¯ãä»å¾åæ§ã®ã±ã¼ã¹ãçºçããªãããåçºé²æ¢ã«åªãã¦ã¾ããã¾ãã
ä»å¾ã¨ããããããé¡ãç³ãä¸ãã¾ãã
ã¦ã¼ã¶ã¼ã®å£°
Twitterãçºãã¦ããéãã§ã¯ãåºèå´ã«é å¸ããã¦ããã¢ããªï¼ã¬ã¹ãã©ã³ã¢ããªï¼ãå©ç¨ã§ããªããªããå注ã®ç¢ºèªãã§ããªããªã£ã¦ããããã§ãã
Open!!!!
— NU BURRITOS (@NuBurritos) 2020å¹´1æ16æ¥
Uber eatsã®ç«¯æ«ä¸å ·åã§ç¾å¨æ³¨æãåããäºãã§ãã¾ãã!!!
ãã¤å¾©æ´»ããããæªå®ã ããã§ã!!!
ãè¿·æããæããã¾ãðââï¸#simokitazawa #UberEats #burrito pic.twitter.com/ff9Lr7C6Rm
åº Uberã¿ãã¬ããæ»äº¡
— ã±ãï¼@ãã¼ã°ã¼ãã¼ã¤é éå¡å ¼ã¬ã¹ãã©ã³ãã¼ããã¼ (@Ubereat56077235) 2020å¹´1æ16æ¥
Uber eatsã¢ããªã§ã¯æ³¨æå¯è½
ãã®å¾ã®å±éã¯é éå¡ãåºã«ãã¦å注çºè¦ã
é éå¡ã¢ããªãã注æåãåããä½ãå§ããããã
é éå¡ãããã¾ããç¡çãã
åºãã©ããããããªãð pic.twitter.com/nXeIBRknFy
ç¾å¨ãUber Eats端æ«ã«é害ãçºçãã¦ããã¾ãããè¿·æãããããã¦ããã¾ããã復æ§ã¾ã§ãã°ãããå¾ ã¡ä¸ããã pic.twitter.com/Iwj0cE13da
— å«è¶ã«ãã©ï½Lupra's Roasting Factory & café (@kaffee_haus) 2020å¹´1æ16æ¥
ä»åº¦ã¯ãåºç«¯æ«ã
— ããã°ð°@UberEATSæ±äº¬ð¸ (@alba_UberEATS) 2020å¹´1æ16æ¥
ãªã³ã©ã¤ã³ã«ãªããªãåé¡ð¤
ããã¯å¤§äºä»¶ã®åãΣ('ââââ)#UberEats pic.twitter.com/YP8Js5ZZDP
React Nativeã£ã½ã
Uber Eatsãã¼ã ãReact Nativeãæ¡ç¨ãã¦ãããã¨ã¯ã次ã®å ¬å¼ã¨ã³ã¸ãã¢ããã°ã§ãè¨åããã¦ãã¾ãã
æ¬ä»¶ã§å ±åãä¸ãã£ã¦ãã赤ãç»é¢ã¯ãReact Nativeã®ãããã°ã¢ã¼ã㧠console.error()
ãæä¸ä½ã¾ã§å°éãã¦ãã¾ã£ãä¾å¤ã®å
容ã表示ããããã®ãRedBoxã¨å¼ã°ããéçºè£å©ã®ããã®æ©è½ã§ããã¬ã¹ãã©ã³ã¢ããªãReact Native製ã¨è¦ã¦åé¡ãªãã§ãããã
2ã¤ã®äºå®ã確èªãã
ããã§ã¯ãReact Nativeã®è¦³ç¹ã§ãä»åå ±åããã¦ããç»é¢ããèªã¿åããå 容ã«ã¤ãã¦è§£èª¬ãã¾ãã主ã«æ¬¡ã®2件ã«ã¤ãã¦è¨åãã¾ãã
- RedBoxã表示ããã¦ãã
- Textã³ã³ãã¼ãã³ãã«ã¤ãã¦ã®ã¨ã©ã¼ãåºã¦ãã
RedBoxã表示ããã¦ãã
ã¾ãã¯ã赤ãç»é¢ï¼RedBoxï¼ãåºã¦ãã件ã«ã¤ãã¦ã§ããç¹°ãè¿ãã«ãªãã¾ããã
æ¬ä»¶ã§å ±åãä¸ãã£ã¦ãã赤ãç»é¢ã¯ãReact Nativeã®ãããã°ã¢ã¼ãã§
console.error()
ãæä¸ä½ã¾ã§å°éãã¦ãã¾ã£ãä¾å¤ã®å 容ã表示ããããã®ãRedBoxã¨å¼ã°ããéçºè£å©ã®ããã®æ©è½
ã§ãã
React Nativeã§ã¢ããªéçºããããã¨ãããæ¹ãªãæ¥å¸¸çã«ç®ã«ãã¦ãããã®ã§ãããããã§ãªãæ¹ã¯ã»ã¼è¦ããã¨ãªãã¨æãã¾ããReact Nativeã¯å¤ãã®æåã¢ããªã§ä½¿ããã¦ããã«ãããããããã§ãã
ã¨ããã®ããRedBoxï¼ã¨console.warn
ãå¸ãYellowBoxï¼ã¯ãªãªã¼ã¹ç¨ã«ãã«ãããéã«ç¡å¹åãããã¹ãã¢ã«å
¬éãããæç¹ã§è¡¨ç¤ºãããªããªã£ã¦ããããã«ãã¦ã¼ã¶ã¼ã¨ãã¦ã¢ããªã触ãå ´åã«ã¯ç®ã«ãããã¨ããªãããã§ãã
次ã®å ¬å¼ããã¥ã¡ã³ãã§ãè¨åããã¦ãã¾ãã
RedBoxes and YellowBoxes are automatically disabled in release (production) builds.
ä»åã®é害ã§ã¯ãUber Eatsã®ã¬ã¹ãã©ã³ã¢ããªã«RedBoxã表示ããã¦ãã¾ããã
誤ã£ã¦ãªã®ãããã¨ãã¨ããããéç¨ãªã®ãã¯ãããã¾ããããä»åé害ã®ãã£ãã¬ã¹ãã©ã³ã¢ããªã¯ãããã°ãã«ãããããã®ã ã£ããã¨ãè¦ã¦åãã¾ãã
Textã³ã³ãã¼ãã³ãã«ã¤ãã¦ã®ã¨ã©ã¼ãåºã¦ãã
RedBox㯠console.error()
ãªã®ã§ããã®ã¨ãçºçããã¨ã©ã¼ã®ã¡ãã»ã¼ã¸ã¨ã¹ã¿ãã¯ãã¬ã¼ã¹ã表示ããã¦ãã¾ããã¡ãã»ã¼ã¸ã®å
容ãè¦ã¦ã¿ã¾ãããã
Invariant Violation: Text strings must be rendered within a
<Text>
component.
ããã¯ãã©ã¦ã¶éçºã«æ £ã親ããã æ¹ãReact Nativeã触ãå§ããã¨ãã«ããããã¨ã©ã¼ã§ãç°¡åã«åç¾ãããã¨ãã§ãã¾ããâã® "Tap to play" ãæ¼ãã¨ãå®è¡çµæãè¦ããã¨ãã§ãã¾ãã
ä»åèµ·ãã¦ããã®ã¯ãJSXå
㧠<Text>
ã³ã³ãã¼ãã³ã以å¤ã®å ´æã«æååãæ¸ãã¨çºçããã¨ã©ã¼ã§ãããã©ã¦ã¶ãªã <div>
ã®ç´ä¸ã«ããã¹ããæ¸ãã¦ãæããã¾ããããReact Native㧠<View>
ã®ç´ä¸ã«ããã¹ããæ¸ãã¨æãããã®ã§ãã((æçµçã«Androidã®TextView
ãiOSã®UIView
ã«è½ã¨ãè¾¼ã¾ãªãã¨è¡¨ç¤ºã§ããªãã¨èããã¨ã妥å½ãªä»æ§ã§ãã))
ããã¯éç解æã§ã¯è¦ã¤ãã¥ããã¨ã©ã¼ãªã®ã§ãã¡ãã£ã¨åæ ã¯ãã¾ããããããè¨ã£ã¦ãã¾ãã°å¡ãã¹ã®é¡ããªã®ã§ãç¹ã«ä»åã®é害ã§React Nativeã®ã¤ãããé²è¦ããã¨ãããããããã¨ã§ã¯ãªãããã«æãã¾ãã
追è¨
使ã£ããã¨ãªãã£ããã©ãeslint-plugin-react-nativeã® react-native/no-raw-text
ã«ã¼ã«ã§æ¤åºã§ãããã
ææ³ã¨éªæ¨
ã¨ããããã§ãTwitterã§å ±åããã¦ããå 容ããèªã¿åããç¯å²ã®äºå®ã«ã¤ãã¦è§£èª¬ãã¾ãããããããã¯ç§å人ã®æè¦ãå¦æ³ã®è©±ã§ãäºå®ã«åºã¥ã話ã§ã¯ãªããã®ãæ··ãã£ã¦ãã¾ããçã«å¾ãã¤ãã¦èªãã§ãã ããã
ãããã°ãã«ãã®è©±ã¯ã¢ããªã®éç¨ã«ã¼ã«ã®è©±ãªã®ã§ãè¯ãã¨ãæªãã¨ãæè¨ã§ããªãé¨åãããã®ã§ãããæ®éã¯ãããªãã§ããã¨ããã®ãããããã°ä¸ã¨ããã®ã¯ãAPKãã¡ã¤ã«ã®ä¸ã«JSãã¡ã¤ã«ãå å ããã®ã§ã¯ãªãããã½ã³ã³å´ã§ç«ã¡ä¸ããéçºãµã¼ãã¼ããJSãã¡ã¤ã«ãé次ã«ãã¦ã³ãã¼ããã¦ç»é¢ã«æç»ãããããé å¸ã«åãã¦ããªãã¯ãã ããã§ãã
â¦â¦ããããã¦ãéçºãµã¼ãã¼ãå
¬éãµã¼ãã¼ã®ä¸ã§èµ·åãã¦ããã¦ãé
å¸ãããããã°ãã«ãã®ã¢ããªããã¢ã¯ã»ã¹ããã¦ããâ¦â¦ï¼ãããããã°ãHot Reloadã®è¦é ã§ãææ°ã®å®è£
ããªã¢ã«ã¿ã¤ã ã§ã¨ã³ãã¦ã¼ã¶ã¼ã®æå
ã«å±ãããâ¦â¦ï¼ããããªãã¨ããâ¦â¦ï¼ãç°¡æCode Pushã¨ãã¦æè¡çã«ã¯å®ç¾å¯è½ãããããªããã©ãæ¬å½ã«ãããâ¦â¦ï¼
å¦æ³ã¯ã§ããã®ã§ãããæ¶æ¸¬ãè¦ã¦ãããã®ããã«èªãã®ããããªãã®ã§ãå£ãå¤ããã¨ã«ãã¾ãããã
追è¨ï¼Textã³ã³ãã¼ãã³ãã®ã¨ã©ã¼ãèµ·ãããã¿ã¼ã³
ã¡ãã£ã¨ã ãè¤éãªãã¿ã¼ã³ãããããã§ãã
æ¨æ¸¬ã§ããçµé¨ä¸ã {str && <Component />} ã¿ããã«æ¡ä»¶åå²æ¸ãã¦ã¦strã«ç©ºæåãæ¥ãã¨ç絡è©ä¾¡ããã¦ç©ºæåãrenderããã¦ãã¾ãã¨ãããã¿ã¼ã³ãªæ°ããã¾ãããã
— ããã®ã (@konoki_nannoki) 2020å¹´1æ16æ¥
æ¡ä»¶å¼ãã¡ããã¨booleanã«ãããä¸é æ¼ç®å使ããæ°ãã¤ããªãã¨èµ·ããã¾ãã https://t.co/HBextTrA8k
ä¾ãã°ããããªã³ã³ãã¼ãã³ãããã£ãã¨ãã¾ãã
type Props = { message: string; }; const Component: React.FC<Props> = ({ message }) => ( <View> {message && <Text>message</Text>} </View> );
ããã <Component message="">
ã®ããã«å¼ã³åºããå ´åãJSXé¨åã®æ¡ä»¶å¼ãè©ä¾¡ããã¦æ¬¡ã®ããã«ãªãã¾ãã
<View> "" </View>
ãããªãã¨Viewã®ç´ä¸ã«ããã¹ãããã¦ãã¾ãã®ã§ãã¢ã¦ãã§ãã空æåã¯falthyãªã®ã§ãç絡è©ä¾¡ã®çµæã¨ãã¦å·¦ãªãã©ã³ãã ããæ®ã£ãå½¢ã§ãããTwitterãè¦ã¦ããã¨ããã®ã±ã¼ã¹ãããããæ¡ä»¶ã®ããã§ãã
ã¨ã¯ãããæ³åã®åãåºãªãã®ã§ãå®éã«ããããå®è£ ãããçµæã¨ãã¦èµ·ããã¨ã©ã¼ã ã¨ããããã§ã¯ããã¾ããã
ãããã«
ä»åã®ä»¶ã¯ãReact Nativeé¢é£ã®é害ã¨ãã¦ã¯åãã¦ã¨è¨ã£ã¦ããã¬ãã«ã®å¤§è¦æ¨¡ãªãã®ã«ãªã£ãããã«æãã¾ããããããªãããReact Nativeã®ããã¨ããã«ã¯ã¡ãã£ã¨éç¨ã®ã»ããåè¡çãããããããªãããªã¨ããææ³ãæã¡ã¾ããã
ãããªäºä¾ãæãã¦ã訳ç¥ãé¡ã§ãããã ããReact Nativeã¿ãããªãã¼ã«ã¯ä¿¡ç¨ã§ããªããã¿ãããªãã¨ãè¨ã人ãåºã¦ããã®ãæ¥è ¹ãªã®ã§ãããã§ã¯ãªãããã¨è¨ãããã«çãåã£ã次第ã§ãã
ããã«ãã¦ããæ¬å½ã«ã©ãããéç¨ããã¦ããã®ãç´ç²ã«ï¼å²ã¨ãã¸ãã£ããªææ ã§ï¼èå³ãåºã¦ãã¾ããããã¤ãReactConfã¨ãApp.js Confãããã§ãä»åã®é害ã«ã¤ãã¦Uber Eatsã®ã¨ã³ã¸ãã¢ããæ¯ãè¿ãã»ãã·ã§ã³ããã£ããããã¨é¢ç½ãã®ã«ãªããã¨æã£ã¦ãã¾ãã
調æ´å¯è½ãªUBER EATSéç帽ã¦ãã»ãã¯ã¹ãã£ãã
- ã¡ãã£ã¢: ã¦ã§ã¢&ã·ã¥ã¼ãº