2021-01-01ãã1å¹´éã®è¨äºä¸è¦§
2021å¹´ã®ITã»ããã°ã©ãã³ã°ã«é¢ãããã¥ã¼ã¹ãå人çã«æ°ã«ãªã£ãã®ãã¾ã¨ãã¦ã¿ã¾ããã
ãã®è¨äºã§ã¯ãåå¿è åãã«Reactã®CRAã§ãTailwind CSSããè¨å®ããã¹ã¿ã¤ãªã³ã°ããæ¹æ³ã«ã¤ãã¦ãã¥ã¼ããªã¢ã«ãæä¾ãã¾ãã
CSSã使ç¨ããReactã§ã®ã¹ã¿ã¤ãªã³ã° CSS Modulesã¨ã¯ CSS Modulesã®ä½æ Reactã§CSSãæ±ãæ¹æ³ã«ã¤ãã¦ãåå¦è ã®æ¹ã«åãã¦ãå©ç¹ããã¡ãªãããå«ãã¦ãç´¹ä»ãããã¨æãã¾ãã Reactã§CSSã®ã¹ã¿ã¤ã«ãè¨å®ããæ¹æ³ã¯ãããã¤ãããã¾ãã ããã§ãæ¬è¨äºâ¦
Javaã¨JavaScriptã®éããåå¿è åãã«å¾¹åºè§£èª¬ãããã¾ãã
Reactã®JSXæ§æããªãæ±ãã®ãï¼ãããã¦ãã®å¿ è¦æ§ã«ã¤ãã¦è©±ãã¦ããããã¨æãã¾ãã
React ã«ã¹ã¿ã ããã¯ã®åºæ¬çãªä½¿ãæ¹ã»ä½æããã¤ä½¿ç¨ããã®ããåå¿è åãã«è§£èª¬è´ãã¾ãã
ãã®ã¬ã¤ãã¯ããªããå¦ç¿ãã¦ããä¸ã§ããè¯ãèããããªãã«ä¸ããã®ãå©ãã¦ãããã§ãããã ãã¯ããã¸ã¼ã¯å¸¸ã«é²åãã ããã°ã©ãã³ã°å¦ç¿ä¸ã«æèããäº å¾æã§ã¯ãªãäºãèªãã å©ããæ±ãããã¨ãæããªã㧠å°ããªç®æ¨ãå®ç¾© æè¨ããã®ã§ã¯ãªãâ¦
ããã°ã©ãã³ã°åå¿è ã1çªæåã«å¦ã¶ã¹ãããã°ã©ãã³ã°è¨èªã®ãªã¹ã¹ã¡ãç´¹ä»è´ãã¾ãã
React.jsããªãããã¾ã§å¼·åãªJSã©ã¤ããªã¨è¨ãããããã«ãªã£ãã®ãã æ´å²ã®ä¸ãããæ¢ã£ã¦ããã¾ãããã
Reactéçºè ã«ãªãã«ã¯æ¬ ãããªããWebpack&Babelã«ã¤ãã¦ããªãã¹ããã£ããã¨è§£èª¬è´ãã¾ãã ã¾ãã¯ãªãå¿ è¦ãªã®ããç解ãã¦ããã¾ãããã
è¤æ°ã§ã®å¯ä½ç¨ã®å ´åãuseEffectãã¯ï¼ã¤ã«ã¾ã¨ãã¦çµã¿åãããã®ã§ã¯ãªãããuseEffectããè¤æ°å¼ã³åºãåããªããã°ããã¾ããã
React Hook useCallbackã®åºç¤ã«ãªãã¾ãã
React.jsã®ä¸ç´è ã«ãªããã¦ã®æ¹ãåãã«ããããä½ãå¦ã¶ããç§ããã®ææ¡ã§ãããã¾ãã
Reactããã¯ã®useRefãä½ã«å½¹ç«ã¡ãããã¦ãããã©ã®ããã«æ±ãã®ã解説è´ãã¾ãã
React Hooksã®ãuseEffectãã¨ãuseLayoutEffectãã®éãã解説è´ãã¾ãã
useStateã®ç解ãã§ããæ¹ã¯ããã«1ã©ã³ã¯ä¸ã®ç¶æ 管çã¸ããã¾ãããï¼ React Hookã®ãuseReducer()ãã®è§£èª¬ãè´ãã¾ãã
æ¬æ¥ã¯Reactããã¯ã§ããç¨ãããããuseContextã§ã®ãã¼ã¿å ±æã«ãªãã¾ãã useContextããã¯ã¯ãReact16.8以éã®ãã¼ã¸ã§ã³ã§ä½¿ç¨å¯è½ã§ãã useContextã¨ã¯ useContextãã㯠使ãæ¹ æå¾ã« useContextã¨ã¯ æ¬æ¥Reactã§ã®è¦ªã³ã³ãã¼ãã³ãããåã®ã³ã³ãâ¦
ååã®è¨äºã§ã¯ãã React.jså°ç¨ã®ä¾¿å©ãã¼ã«ããç´¹ä»ãã¾ããããããã§ã¯Reactãéçºè 以å¤ã®æ¹ã«ã¨ã£ã¦ã¯å½¹ã«ç«ããªããã®ã§ããã ã¾ããããã«ä»¥åã¯ãGoogleã§ã®æ¤ç´¢æ¹æ³ãããGoogle Chromeæ¡å¼µæ©è½ããç´¹ä»ãã¾ããããæ¬æ¥ã¯ããã«å¹ åºãç¯å²ã§ãâ¦
Reactã«é¢é£ããå¹ççãªUIæ§ç¯ã¨ãããã°ã®ããã®å¿ é ãã¼ã«ãç´¹ä»ãã¾ãã
React.jsã®Hooksã«ã¤ãã¦åãã¦å¦ã¶åå¿è ã®æ¹ã åãã«ãç°¡æ½ãã¤åããããã説æããã¾ã¨ããè¨äºã¨ãªãã¾ãã
æ¬æ¥ã¯Reactã使ç¨ããéçWebãµã¤ãã®å¶ä½ã«ã¤ãã¦ã«ãªãã¾ãã ãªã¢ã«DOMã¨ä»®æ³DOMã«ã¤ã㦠SSR SSG SSGã®ãµã¤ãã¯CMSããéã?? æå¾ã« ãªã¢ã«DOMã¨ä»®æ³DOMã«ã¤ã㦠Webãã¼ã¸ã®ååãã¼ãã«ããã¦ããªã¢ã«DOMã使ç¨ããã¬ã³ããªã³ã°ã¯ãJavaScriptãJQueâ¦
React.jsãç¬å¦ã§å¦ãã§ããåå¿è ã®æ¹ã«åãã¦ãå®éã«ç§ãç¬å¦ã§å¦ãã§ããçµé¨ãå ã«ãç¾å½¹ã®Reactããã°ã©ãã¼ãå®å ¨ãªReactãã¼ãããããä½æãã¾ããã åå¿è ã®æ¹ã«ã¨ã£ã¦ã¯ãå½è¨äºã®ãã¼ãããããåãã¦è¦ãã¨ãã¯å°ãå§åãããããããã¾ãããâ¦
ããã«ã¡ã¯ãçæ§ã ä»åã¯ãçè ãå人çã«èãã¦ãããã¨ãå ±æãããã¨æãã¾ããã ããã°ã©ãã³ã°ã®è¨äºãæ¸ãæéããªãã£ããããå°ãç§çãªè©±ã«ãªãã¾ãããã¨ã³ã¸ãã¢ã«ãªãããã¨èãã¦ããæ¹ãããã§ãªãæ¹ãå«ãã¦ãããããã®äººçã«å½¹ç«ã¤èãâ¦
JavaScriptã«å ¥ãåã«æãã¦ãããªããã°ãããªãDOMã«ã¤ãã¦å¦ãã§ããã¾ãããï¼
ããå ±åã1ã¶æã§1ä¸PVçªç ´ï¼æè¬ã®æ°æã¡ãè¾¼ã㦠ã¯ã¦ãªããã°ãéè¨ãã¦ãããæ¬æ¥ã§1ã¶æãçµã¡ã¾ããï¼ãã®1ã¶æéã§æéãã¼ã¸ãã¥ã¼æ°ã1ä¸ãçªç ´ããç§ã«ã¨ã£ã¦ã¯ç´ æ´ãããåºæ¥äºã§ãã ãã®å ´ãåãã¦ãçæ§ã«æè¬ã®æ°æã¡ãä¼ãããæãã¾ãã â¦
ã¯ããã« ã©ã¤ãã©ãª ãã¬ã¼ã ã¯ã¼ã¯ æå¾ã« ã¯ããã« Webéçºãå¦ã¶éãå¿ ãã¨è¨ã£ã¦ããã»ã©åºãããç¨èªããã©ã¤ãã©ãªãã¨ããã¬ã¼ã ã¯ã¼ã¯ãã§ãã ãããããããã®ç¨èªã®éãã«ã¤ãã¦ç解ãããã¨ã¯ç°¡åã§ã¯ããã¾ããã å¤ãã®äººã¯Googleã§æ¤ç´¢ãã¦â¦
Reactã§ã®ã¨ã©ã¼å¦çã«ãå°ãã®æ¹ã¯ã¾ããã¡ããå¦ãã§ãããå¥ã®è§£æ±ºçã«é²ãã§ä¸ããã
æ§æ Propsã®åãæ±ã ç¶æ ã©ã¤ããµã¤ã¯ã« ç¬èªãã㯠è£è¶³ æå¾ã« Reactã§ã³ã¼ããæ¸ãå§ããã¨ãJSXæ§æãé¢æ°ã³ã³ãã¼ãã³ãã¨ã¯ã©ã¹ã³ã³ãã¼ãã³ãã®éããªã©ãReactã®ããã¤ãã®ç¹ã§æ··ä¹±ãããã¨ãåå¿è ã§ã¯ããããã¾ãã æ¬æ¥ã¯React JSã®ã¯ã©ã¹ã³â¦
Webã¢ããªéçºã¨ã³ã¸ãã¢ãå人çã«ç´¹ä»ããChromeã®æ¡å¼µæ©è½ã«ãªãã¾ãï¼
Reactãå¦ç¿ä¸ã®æ¹ããSPAã®éçºãæ軽ã«å§ãããæ¹ã«ã¯ãCreate-React-Appï¼CRAï¼ã¨ããCLIãã¼ã«ãããããã§ãã ãã®ãã¼ã«ã¯ãReactããã¸ã§ã¯ãã®éå½¢ãæä¾ããåæè¨å®ãèªåçã«è¡ã£ã¦ããã¾ãã CRAã使ç¨ããã¨ããã£ã¬ã¯ããªæ§æãèªåçã«ä½æâ¦