Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
useEffectã¯Reactã®ä¸ã§ãæ±ãã®é£ããããã¯ã¨ãã¦ç¥ããã¦ãã¾ããReactã§éçºãè¡ãä¸ã§useEffectãæ¤è¨ããã¿ã¤ãã³ã°ãé©åãªä½¿ãæ¹ã«ã¤ãã¦æ©ãã çµé¨ã®ããæ¹ãå¤ãã®ã§ã¯ãªãã§ããããã æ¬è¨äºã§ã¯ãuseEffectã®ç®çãææ¡ããã©ã®ãããªå ´åã«useEffectã®ä½¿ç¨ãæ¤è¨ãã¹ããã«ã¤ãã¦èãã¦ããããã¨æãã¾ãã ã³ã³ãã¼ãã³ãã®ç´ç²æ§ã¨å¯ä½ç¨ ã¾ãuseEffectã«ã¤ãã¦èããåã«ãã³ã³ãã¼ãã³ãã®ç´ç²æ§ã«ã¤ãã¦ç解ããå¿ è¦ãããã¾ããReactã«ããã¦ç´ç²æ§ã¯éè¦ãªæ¦å¿µã®1ã¤ã§ãã åæã¨ãã¦ãReactã§ã¯ãã¹ã¦ã®ã³ã³ãã¼ãã³ããç´é¢æ°ã§ãããã¨ãä»®å®ãã¦ãã¾ãã Reactã¯ãããªããæ¸ããã¹ã¦ã®ã³ã³ãã¼ãã³ããç´é¢æ°ã§ããã¨ä»®å®ãã¦ãã¾ãã åç §ï¼https://ja.react.dev/learn/keeping-components-pure
javascripter ã§ããããã¼ã§ã¯ãåæã¡ã³ãã¼ã¨ãã¦ãããã¯ãã®ãã¼ã³ãåããAutoReserve ã®éçºã«é¢ãã£ã¦ãã¾ãã ååã®è¨äºã«å¼ãç¶ããçè ã社å ã§æ¸ãã¦ããæè¡ã¬ã¤ãã©ã¤ã³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ã¯ããã« ããã¼ã§ã¯ãé«å質ãªã³ã¼ããç¶æããéçºãã¼ã ã®æè¡ã¬ãã«åä¸ãå³ãããããã¼ã 横æçã«ãæç¨ãªæè¡Tipsããã¹ããã©ã¯ãã£ã¹ã»ã³ã¼ãã£ã³ã°ã¬ã¤ãã©ã¤ã³ãªã©æ å ±ãNotionä¸ã«éç´ããèªç±ã«ã¨ã³ã¸ãã¢ãé²è¦§ã»ç·¨éã§ããããã«ãªã£ã¦ãã¾ãã ãã®åãçµã¿ã®ç®çã¯ä»¥ä¸ã®éãã§ãï¼ ã³ã¼ãå質ã®åä¸ã¨çµ±ä¸ éçºãã¼ã ã¡ã³ãã¼ã®æè¡ã¹ãã«åä¸ ãã©ããç´ããã§ã§ã¯ãªãããªããããä¿®æ£ãã¹ããã¾ã§ç解ãã¦ã人ãå¢ãã å¹ççãªéçºããã»ã¹ã®ç¢ºç« ååã®è¨äºã«ã¤ãã¦ã¯ããã¡ããåç §ä¸ããã Reactãã¹ããã©ã¯ãã£ã¹: react-hooks/exhaustive-de
javascripter ã§ããããã¼ã§ã¯ããããã¯ãã®ãã¼ã³ãåããAutoReserve ã®éçºã«é¢ãã£ã¦ãã¾ãã ä»åã¯ãçè ã社å ã§æ¸ãã¦ããæè¡ã¬ã¤ãã©ã¤ã³ã«ã¤ãã¦ç´¹ä»ãã¾ãã ã¯ããã« ããã¼ã§ã¯ãé«å質ãªã³ã¼ããç¶æããéçºãã¼ã ã®æè¡ã¬ãã«åä¸ãå³ãããã社å ã§ç¶ç¶çã«æè¡Tipsãã¬ã¤ãã©ã¤ã³ã®æ´åã»èç©ãè¡ã£ã¦ãã¾ãã ãã¼ã 横æçã«ãæç¨ãªæè¡Tipsããã¹ããã©ã¯ãã£ã¹ã»ã³ã¼ãã£ã³ã°ã¬ã¤ãã©ã¤ã³ãªã©æ å ±ãNotionä¸ã«éç´ããèªç±ã«ã¨ã³ã¸ãã¢ãé²è¦§ã»ç·¨éã§ããããã«ãªã£ã¦ãã¾ãã ãã®åãçµã¿ã®ç®çã¯ä»¥ä¸ã®éãã§ãï¼ ã³ã¼ãå質ã®åä¸ã¨çµ±ä¸ éçºãã¼ã ã¡ã³ãã¼ã®æè¡ã¹ãã«åä¸ ãã©ããç´ããã§ã§ã¯ãªãããªããããä¿®æ£ãã¹ããã¾ã§ç解ãã¦ã人ãå¢ãã å¹ççãªéçºããã»ã¹ã®ç¢ºç« æ°ã¡ã³ãã¼ã®ãªã³ãã¼ãã£ã³ã°æ¯æ´ ä»åç´¹ä»ããããã¥ã¡ã³ã ä»åã¯ããã®ä¸ãããreac
Reactã¨ç¶æ ã¯åã£ã¦ãåããªãé¢ä¿ã§ãããªããªããReactã¯ç¶æ ã«åºã¥ãã¦ç»é¢ãæ´æ°ããã³ã³ãã¼ãã³ããã¼ã¹ã®UIã©ã¤ãã©ãªã ããã§ãð¤ð» ãããªReactã®ç¶æ ã管çã»æä½ãããããã¦ããã¦ããã®ããReact 16.8ããç»å ´ããããã¯ã§ãããããããããã¯ãæ£ããå©ç¨ããã«ããã£ã¦Reactã®ç¶æ ã®ç解ã¯é常ã«éè¦ã§ãããReactã®ç¶æ ã®ç解ããããµãã ã¨ãäºæãã¬æåããã°ã®ãã¨ã«ãªãããã¾ããã ä»åã®è¨äºã§ã¯ãReactã®ç¶æ ãç解ããªããé©åãªç®æã§é©åãªHooksãé¸æãã¦ããããã»ã¹ãå確èªã§ããï¼èªä¿¡ãæã£ã¦Reactãã³ã³ããã¼ã«ã§ããããã«ãªãããï¼ã¨è¨ãããã¨ãã´ã¼ã«ã¨ãã¦ãã¾ãð ä»å使ç¨ããå³å¸å¿åã¡ã¢ã¢ããªã®ã³ã¼ããã¼ã¹ã§ãã ãµã¼ã¯ã«ã§ã¯ãã³ãããã«æ²¿ã£ã¦èª¬æããã¦ããã¾ãããï¼ããã¾ã§å³å¸ãªã®ã§ç´°ãããã¨æ°ã«ããªããä½ã£ã¦ã¾ããorzï¼ ã
ã¯ããã« React ã¯å é¨ã§ã®ããã©ã¼ãã³ã¹æé©åã«ãã UI æ´æ°ã«å¿ è¦ãª DOM æä½ã®æ°ã軽æ¸ãã¦ãã¾ããæ¬è¨äºã§ã¯ãããã« React ã¢ããªã±ã¼ã·ã§ã³ãæé©åãããã¯ããã¯ãç´¹ä»ãã¾ãã åæç¥è 以ä¸ã«ã¬ã³ããªã³ã°ã®ä»çµã¿çã解説ãã¾ãããã§ã«ãåç¥ã®æ¹ã¯é£ã°ãã¦ãã¯ããã¯ã®ç« ããèªã¿ãã ããã React ãã©ã®ããã« UI ãæ´æ°ããã®ã ã¬ã³ããªã³ã°ãããã³ã³ãã¼ãã³ããä½æããæãReact ã¯ã³ã³ãã¼ãã³ãã®è¦ç´ æ¨ã«å¯¾ãã¦virtual DOMãä½æãã¾ããã³ã³ãã¼ãã³ãã®ç¶æ ãå¤ãããã³ã« React 㯠virtual DOM æ¨ãä½æã以åã®ã¬ã³ããªã³ã°çµæã¨æ¯è¼ãã¾ãããããã®éãã®ã¿ãå¤æ´ãããè¦ç´ ã®å®éã® DOM ã«åæ ãã¾ãã å®éã® DOM ã¯æä½ããã®ã«ããã©ã¼ãã³ã¹ã³ã¹ããããããããReact 㯠virtual DOM ãç¨ãããã¨ã§åã¬ã³ã
æ¬ãµã¤ã㯠Next.js å ¬å¼ããã¥ã¡ã³ãã®æ¥æ¬èªç¿»è¨³ãµã¤ãã§ãã Next.js ã®å ¬å¼ X ã¢ã«ã¦ã³ãã«ããã¹ãé ãã¾ããã ç¾å¨ãæ¬ãµã¤ãã§ã¯ Canary Version ã®ã¢ãããã¼ãã«è¿½å¾ãããã®å 容ã翻訳ãã¦ãã¾ãã Next.js ã¨ã¯ï¼â Next.js ã¯ããã«ã¹ã¿ã㯠Web ã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ããããã® React ãã¬ã¼ã ã¯ã¼ã¯ã§ããã¦ã¼ã¶ã¼ã¤ã³ã¿ã¼ãã§ã¼ã¹ãæ§ç¯ããããã« React ã³ã³ãã¼ãã³ãã使ç¨ããNext.js ã使ç¨ãã¦è¿½å ã®æ©è½ãæé©åãè¡ãã¾ãã Next.js ã¯ãå é¨ã§ãã³ãã«ãã³ã³ãã¤ã«ãªã©ã® React ã«å¿ è¦ãªãã¼ã«ãæ½è±¡åããèªåçã«è¨å®ãã¾ããããã«ãããè¨å®ã«æéãè²»ãã代ããã«ãã¢ããªã±ã¼ã·ã§ã³ã®æ§ç¯ã«éä¸ã§ãã¾ãã å人éçºè ã§ããã¼ã ã®ä¸å¡ã§ããNext.js ã¯ã¤ã³ã¿ã©ã¯ãã£ãã§ãã¤ãããã¯ãããã¦é«é㪠Reac
React ã® useEffect ã®å®è¡ã¿ã¤ãã³ã°ã«ã¤ãã¦ããã®ããã«æã£ã¦ãã¾ãããï¼ ä¾åé åï¼ç¬¬2å¼æ°ã¨ãã¦æ¸¡ãé åï¼ãçç¥ãããããã¦ã³ãæã«ããã®ãã¨åã¬ã³ãã¼ãã¨ã«å®è¡ããã ä¾åé åã«ç©ºé åãå ¥ãããããã¦ã³ãæã«å®è¡ããã ä¾åé åã«å¤ãå ¥ããã¨ããã¦ã³ãæã¨ãå¤ãå¤ãããã¨ã«å®è¡ããã ãããã¯ãªã¼ã³ã¢ããé¢æ°ã絡ãã§æ¥ã¦ããã£ã¨è¤éã§è¦ããããªã⦠â¦ãã®ããã«èããå¿ è¦ã¯ããã¾ããã å®ã¯ãuseEffect ã®è¦åã¯è³ã£ã¦ã·ã³ãã«ã§ãããã UI ãã¸ãã¯ã®é »åºã®èª²é¡ãæ´ç·´ããããã¿ã¼ã³ã«è½ã¨ãè¾¼ãã§è§£æ±ºãã¦ããã¾ãã ã¨ãã§ã¯ãã¨ã¯ãªã¼ã³ã¢ããã®å®è¡ã¿ã¤ãã³ã°ã¯ã以ä¸ã®ããã«è«ççã«ã·ã³ãã«ãªå½¢ã§æãããã¨ãã§ãã¾ãã ãã¦ã³ãæ ã«ååã®ã¨ãã§ã¯ããçºç«ãããã¢ã³ãã¦ã³ãæ ã«æå¾ã®ã¯ãªã¼ã³ã¢ãããå®è¡ãããã åã¬ã³ããªã³ã°æ ã«ãååã®ã¨ãã§ã¯ããã¯ãªã¼ã³
æè¿ãNext.jsãè¤éã«ãªãããã¦ãåãªãã¦ã§ãç»é¢ãä½ãç¨éã«ã¯Next.jsã¯éãããã®ã§å¥ã®ãã®ãè¯ãã¨ããVercelçµ±åã®ããã®æ©è½ãå¤ããã§ãããã¿ãããªææ³ãè¦ããããã¨ãå¢ããæ°ããã¾ããç¹ã«ç®¡çç»é¢ã¨ã社å ã·ã¹ãã ã¨ãã§ãããB2Cã§ãè¨å®ç»é¢ç³»ã¨ãã¯å½ã¦ã¯ã¾ãããããã¾ããã ãã³ãæ代ã«ãã¿ã¤ãRãè²·ã£ã¦ãå®éã«ãµã¼ãããã¨ãã«èµ°ããã«è¡ã人ã¯1/10ããããã¨ãã話ãèããæ°ããã¾ãããå¿ ãããããã®ãã¹ã¦ã®ããã©ã¼ãã³ã¹ãå¼ãåºããªãã®ã¯ãã¡ã¨ããªãã¦ãåã«ãã£ãããããã¨ããä¸é¨ã®ã¡ãªããã§ãèªåã«ããã°è¯ãã®ã§ãã Next.jsããããããæ©è½ãããã¾ããããããã ãªä½¿ãæ¹ãã§ãã¾ãã ã»ã¼Next.jsã®æ©è½ããªãã«ãã使ãæ¹ãã¶ãNext.jsãæä½éã§ä½¿ãã©ã¤ã³ã»ã¡ãªããã¯ããããªãã¨æãã¾ãã åºæ¬çã«å ¨é¨CSR(Client Side Rend
ã¢ãã³ããã³ãã¨ã³ãã«ã¤ãã¦åãã¦æ¸ãã¾ãããææããã«ã æè¿ React 㨠Next.js ã«å ¥éããã®ã§ãããå ¥éæç¹ã§ä¸çªæåã«ç¥ã£ã¦ããããã£ããã¨ã«ã¤ãã¦æ¸ãã¾ããã ãReact åå¿è ã useState ã¨ããå¦ç¿ããåã«ã¾ãä¸çªã«ãããã¨ã¯ãããã£ã¦ããå 容ã§ããã ã¿ã¤ãã«ã¯èªåã¸ã®æãã§ãã TL;DR ãã®è¨äºãèªã㨠React Developer Tools ã®ç°¡åãªä½¿ãæ¹ãç¥ããuseState ã®åã¬ã³ããªã³ã°ã«ã¤ãã¦åããã¤ã¡ã¼ã¸ã§ããããã«ãªãã¨æãã¾ã React Developer Tools ããã®ãã¨ãReact ã使ã£ãéçºãããã®ã§ããã°ãå¿ ãå°å ¥ããªãã¨ãããªãã¬ãã«ã®ãã®ã åã¬ã³ããªã³ã°æãã¤ã©ã¤ãã®è¨å® React Developer Tools ãã¤ã³ã¹ãã¼ã«ããå¾ãF12 ãæ¼ä¸ã㦠Component ãé¸æãã®æ¯è»ãæ¼ä¸ã
ã¯ããã« ãã®è¨äºã¯ãAlan Alickovicããã®èæ¸ãReact Application Architecture for Productionããã¾ã¨ãããã®ã«ãªãã¾ããAlanããã¨è¨ãã°Zennã§æã人æ°ã®ããè¨äºãbulletproof-reactãã®ä½è ã§ãããå½¼ã®projectããå¦ã¶ãã¨ã¯ã¨ã¦ãå¤ãå°è±¡ã§ãã ä»åç´¹ä»ããæ¬ã¯2023å¹´1æã«å ¬éããããããbulletproof-react以å¾ã®Reactã¢ããªã±ã¼ã·ã§ã³ã«ããããã¹ããã©ã¯ãã£ã¹ã®å®åº«ã¨ãªã£ã¦ãã¾ããã¾ããæ¬ã§æ±ããã¦ããã¢ããªã±ã¼ã·ã§ã³ã®ProjectãGitHubã§å ¬éããã¦ãããã¨ãããProjectãçºããã ãã§ãåå¼·ã«ãªãç¹ããããã¨æãã¾ãã æ³å®èªè Reactã®ã¢ã¼ããã¯ãã£ã模索ãã¦ããæ¹ ãã¹ãææ³ãCI/CDãªã©ã®ã¢ããªã±ã¼ã·ã§ã³è¨è¨ã«é¢å¿ãããæ¹ ä½¿ç¨ãããæè¡ã¨æ¬ã®æ§æ è¨
ãã®è¨äºã¯Reactå ¬å¼ã®å 容ã翻訳ã»ç´¹ä»ãããã®ã§ã¯ããã¾ãããçè ã®è§£éãç解ãä¼ãããã®ã§ãããReactã®å ¬å¼è¦è§£ã¨ä¸è´ãã¦ããã¨ã¯éãã¾ãããããããããäºæ¿ãã ããã çããããã«ã¡ã¯ãæè¿Next.js 13.4ããªãªã¼ã¹ãããApp Routerãstableæ±ãã«ãªãã¾ãããApp Routerã¯React Server Component (RSC) ããµãã ãã«ç¨ãã¦æ§ç¯ããã¦ãã¾ãã Reactæ¬ä½ã§Server Componentããã£ã¨alphaçãªã®ã«Next.jsã§betaã¨ãstableã¨ãè¨ã£ã¦ãã®ã¯ä½ã§ï¼ãã¨ããåé¡ããReact Canaryã®ã¢ãã¦ã³ã¹ã«ããç¡äºã«è§£æ¶ããã¾ããã React Canaryã£ã¦ãªã«ï¼ å æ¥Reactå ¬å¼ããã°ã§ã¢ãã¦ã³ã¹ããããæ°ãããªãªã¼ã¹ãã£ãã«ã§ãã çè ã®ç解ã«ããæ¦è¦ããä¼ãããã¨ãCanaryçã®Reac
Reactã³ã³ãã¼ãã³ãã®éçºæããã¼ã¿ãã§ããã¯æ¬ ããã¾ããã SPAã§éçºãè¡ãæãããªããå«ãã¦useEffect()ã使ã£ããã¨ãããã¯ãã§ãã ããªããSWRãReact Queryã®ä»£ããã«useEffect()ã使ãçç±ã¯ãããã¤ãããã®ã§ãããã ãããªæ¹ã®ããã«ãReactãæä¾ãã<Suspense>ã使ã£ã¦ãã¼ã¿ãã§ãããè¡ãæ¹æ³ãç´¹ä»ãã¾ãã 追è¨: Suspenseã§ã¯ã¦ã©ã¼ã¿ã¼ãã©ã¼ã«åé¡ã解決ã§ããªãã¨ã®ææã«ã¤ã㦠ãSuspenseã®å®è£ ãã«è¨è¼ã®ã³ã¼ããè¦ãéããã¦ã©ã¼ã¿ã¼ãã©ã¼ã«åé¡ã解決ã§ããªãã¨ã®ææãããã¾ããã å®è£ ã®ç« ã§ã¯åé¡ã解決ãããã¨ã§ã¯ãªãã<Suspense>ãã©ã®ããã«ä½¿ããã«ç¦ç¹ãå½ã¦ã¾ããã å ·ä½çãªå®è£ æ¹æ³ã«è¸ã¿è¾¼ãã¨ãã¼ããã大ããå¤ãã¦ãã¾ãå¯è½æ§ããã£ãããã§ãã èªã¿ããããåªå ããçµæã解決ã®ããã®å®è£ ã«ã¤ãã¦ã¯å²
Reactã®useEffectã¯ãããã¯ã®ä¸ã§ã使ãæ¹ãé£ãããã®ã®ä¸ã¤ã§ããããã§ããã®è¨äºã§ã¯çè ãèããuseEffectã®æã¾ãã使ãæ¹ãçããã«ä¼æãã¾ãã åºæ¬åå æè¡ããã®è¦ç´ ã®ä½¿ãæ¹ãèããã«ããã£ã¦ãçè ã好ãã§ããã®ã¯åºæ¬ååãç½®ãã¦ããã«åºã¥ãã¦å¤æãããã¨ã§ããã¨ãããã¨ã§ããã®è¨äºã§ã¯ã¾ãçè ãèããReactã®åºæ¬ååãç´¹ä»ãã¾ãã çè ããã£ã¨ãéè¦è¦ããååã¯ãReactã¯UIã©ã¤ãã©ãªã§ããã¨ãããã¨ã§ããã¤ã¾ããReactã«ã¯UIã®ç®¡çããããã¹ãã§ãã£ã¦ããã®ä»ã®ãã¨ã¯Reactã®å½¹ç®ã§ã¯ãªãã¨ãããã¨ã§ããReactãé£ããã¨æã人ãããå ´åãä½ã§ãããã§ãReactã«ãããããã¨ããããä½è¨ã«é£ãããªã£ã¦ããã®ã ã¨æãã¾ãã ä¾ãã°ã¢ããªã±ã¼ã·ã§ã³ã®ãã¸ãã¯ã®ç®¡çãããã«ä»éããã¹ãã¼ãã®ç®¡çã¯Reactã®å½¹ç®ã§ã¯ãªãã®ã§ãReactã®å¤é¨ã§å¦ç
ã¯ããã« ZOZOTOWNéçºæ¬é¨ã®æ¦äºã¨ç³ãã¾ããZOZOTOWNã®ããã³ãã¨ã³ããªãã¬ã¤ã¹ããã¸ã§ã¯ãã主ã«æ å½ãã¦ããã¾ããZOZO DEVELOPERS BLOG ã§ããZOZOã®ãªãã¬ã¤ã¹ããã¸ã§ã¯ãã§å¾ãããå¯ä¸ç¡äºã®çµé¨ã大è¦æ¨¡ãµã¼ãã¹ãé²åãããããããã¨ã¯ãã¨ããã¤ã³ã¿ãã¥ã¼è¨äºãæ²è¼ãã¦ããã¾ãã®ã§ããããããããã°ãã¡ããä½µãã¦ã覧ãã ããã ãã¦ãæ¬é¡ã§ããç¾å¨ZOZOTOWNã§ã¯ãªã³ãã¬ãã¹ãã¤ãã¢ããªã¹ã ã£ãæ¢åã·ã¹ãã ããã¤ã¯ããµã¼ãã¹APIã«è²¬åãåå²ããããã¤ã³ãã©ãã¯ã©ã¦ãã«ç§»è¡ããããã¦ãã¾ããããããããããWebã®UIãæ§ç¯ããããã®ã·ã¹ãã ã¯ç¾å¨ãæ¢åã·ã¹ãã ã«æ°æ©è½éçºãæ©è½æ¹ä¿®ãè¡ãªã£ã¦ããããªãã¬ã¤ã¹ã«çæã§ãã¦ãã¾ããã§ããã ããã§ãã¾ããã¼ã ç»é¢ãã段éçã«ãªãã¬ã¤ã¹ãã¹ãè¨è¨ã»éçºãæ¨å¹´ããè¡ãªããç¡äºãªãªã¼ã¹ã§ãã¾ãããZOZOT
2024/04/17: æ´æ° å 容ãæ´æ°ããè¨äºãæ¸ãã¾ããã®ã§ãããã£ãããã¡ããä½µãã¦ãã覧ãã ããã zenn.dev ããã«ã¡ã¯ï¼ããã³ãã¨ã³ãã¨ãã¹ãã¼ããã¼ã ã®@nus3_ã§ãã kintone ã®ããã³ãã¨ã³ãå·æ°ããã¸ã§ã¯ãï¼ãããªã¢ï¼ã§ã¯ãå質ãä¿ã£ãã¾ã¾éçºãå éãããããã«ããã³ãã¨ã³ãã®ãã¹ããç©æ¥µçã«è¡ã£ã¦ãã¾ãã ä»åã¯ãããªããã³ãã¨ã³ãã®ãã¹ãã®å®è£ ä¾ãããã¤ãç´¹ä»ãã¾ãããã®è¨äºãããã³ãã¨ã³ãã®ãã¹ããè¡ãä¸ã§ã®åèã«ãªãã°å¹¸ãã§ãã ãã¹ãã«ä½¿ç¨ãã主ãªããã±ã¼ã¸ ã³ã³ãã¼ãã³ãã®ãã¹ã è£è¶³: Testing Library ã®è¨æ³ããã§ãã¯ãã¦ãããeslint-plugin-testing-library ã«ã¹ã¿ã ããã¯ã®ãã¹ã è£è¶³: React v18 ã§ã¯ @testing-library/react ã® renderHook ã使ã åè
ã¯ããã« ä»å¾ã®Reactã§ã¯ã©ã®ç¯å²ãSuspenseã§å²ãã ã¨ããè¨è¨ãéè¦ã«ãªã£ã¦ãããã¨ãã話ãSuspenseã®èª¬æã¨ã¨ãã«ãã¦ããã¾ãï¼ â»React18ããªãªã¼ã¹ããã¦ï¼å¹´è¿ãçµã¤ã®ã§ä»æ´æããããããã¾ãããããä»ãåããã ããã Suspense ã¨ã¯ React18ã§æ£å¼ãªæ©è½ã¨ãã¦å®è£ ãããæ©è½ â»React16.6ã§å®é¨çæ©è½ã¨ãã¦è¿½å ããã¦ãã Suspense ã§ã§ããã㨠ãã¼ã¿åå¾ä¸ãã¼ãã£ã³ã°ç¶æ ã®å®£è¨çãªè¨è¿° ã³ã³ãã¼ãã³ãåä½ã§ã®SSR ã³ã³ãã¼ãã³ãåä½ã§ã®JSãã¼ã ã³ã³ãã¼ãã³ãåä½ã§ã®Hydration Suspense ã¯åã«ãã¼ãã£ã³ã°ã宣è¨çã«è¨è¿°ã§ããã ãã®æ©è½ã§ã¯ãªã Suspenseã¯ãã¼ãã£ã³ã°ã宣è¨çã«è¨è¿°ã§ãããã®ãã¨ãã£ãå 容ãç®ã«ãããã¨ãå¤ãå°è±¡ã§ãã ããããSuspenseã¯åã«ãã¼ãã£ã³ã°ã宣è¨çã«è¨è¿°ã§ããã ã
ã¯ããã« ããã«ã¡ã¯ãã©ã¯ã¹ããã³ãã¨ã³ãéçºèª²ã®æè¤ã§ãã è¨äºã¿ã¤ãã«ã¯Reactéçºè ãªãç¥ã人ãç¥ãããã¯ãï¼ TypeScriptã§å§ããã¤ãããªãReactéçºã®ãããã£ã§ããã¨ã¦ãããããããå ¥éæ¸ãªã®ã§Reactåå¦è ã®æ¹ã«ã¯å¦ã³ã®ç¬¬ä¸æ©ã¨ãã¦èªä¿¡ãæã£ã¦ãªã¹ã¹ã¡ã§ãã¾ãï¼ ãã¦ä»åã¯ãã¢ãã³ãªããã³ãã¨ã³ãæè¡ãæ¡ç¨ããããã§ã極åã·ã³ãã«ã§éçºä½é¨ãæãªããªããããªãã£ã¬ã¯ããªæ§æãèãã¦ã¿ãã®ã§å ±æãããè¨äºã«ãã¾ãããç¾å¨å®éã«éç¨ãã¦ããã®ã§ãããä»ã®ã¨ãã大ããªåé¡ãç¡ããã¼ã ããã®ä¸æºãä¸ãã£ã¦ãã¾ãããããããå人çã«å¾®å¦ãªé¨åãããã®ã§ãã¡ãã®ç´¹ä»ãè¡ãããã¨æãã¾ãã ä»åãæ§æãèããã«ããã£ã¦éè¦ãããã¤ã³ãã¯ä»¥ä¸ã®3ç¹ã§ãã æ°ããåå ¥ããã¡ã³ãã¼ã§ãããã«ç解ã§ããã·ã³ãã«ãªæ§æã«ããã ãã¹ãããªãã¡ã¯ã¿ããããæ§æã«ããã ã§ããã°ã«ã¼ã«ãå³
Zennã§ã¯ããã³ãã¨ã³ãã«Next.jsã使ã£ã¦ãã¾ãããã¨ãã¨ã¯Vercelã§åããã¦ããã®ã§ããã2021å¹´3æã«Google Cloudã«ç§»è¡ãã¾ãããä»åã¯ç§»è¡ã決ããçç±ããå ·ä½çãªæ§æã移è¡ä½æ¥ãªã©ã«ã¤ãã¦æ¸ãããã¨æãã¾ãã ãªã移è¡ããã®ã Next.jsã®ãããã¤å ã¨ãã¦Vercelã¯å§åçã«åªãã¦ãã¾ããISRãImage Optimizationã¨ãã£ãNext.jsã®å¼·åãªæ©è½ããµã¼ãã¼å´ã®è¿½å è¨å®ãªãã§ä½¿ç¨ã§ãã¾ãããCDNã§ã®éçãã¡ã¤ã«ã®ãã£ãã·ã¥ãªã©ãç¹ã«æèããªãã¦ãããæãã«ãã£ã¦ããã¾ãã Vercel以å¤ã«ãããã¤ããã¨ãªãã¨ãNext.jsã®ä¸é¨ã®æ©è½ããã¾ãåããªãã£ãããããã©ã¼ãã³ã¹ã»ãã¥ã¼ãã³ã°ãèªåã§é å¼µãå¿ è¦ããã£ããã¨èªåã§é¢åãè¦ãªããã°ãªããªãé¨åãå¤ããªãã¾ãã ããããZennã®ã±ã¼ã¹ã§ã¯ä»¥ä¸ã®ãããªçç±ããVercelãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}