ç§ã®æè¡è¨äºã®æ¸ãæ¹
æè¡è¨äºãæ¸ããã¨ã¯ãæåã¯ãªããªããã¼ãã«ã®é«ãä½æ¥ã«æãã¾ããæç« ãæ¸ãã«ã¯ããç¨åº¦ã®æ £ããå¿ è¦ã§ããèãã¦ãã¾ãã
誰ããåãã®ãã¡ã¯ãã¾ãæç« ãæ¸ããã¨ãã§ãããæç« ãæ¸ãè¨ç·´ãéãããã¨ã§ãå 容ãä¼ããããã»ç解ãããããã種ã®ãåããçºè¦ããã¦ããã®ã§ã¯ãªããã¨æã£ã¦ãã¾ãã
ãã®è¨äºã§ã¯ id:azukiazusa ãæ®æ®µè¨äºãæ¸ãæã«èãã¦ãããã¨ãæ¸ãä¸ãã¦ããã¾ãã
- è¦åºããå ã«æ¸ã
- ã³ã¼ãã¯å®è¡å¯è½ã«ãã
- è¨äºã¯1æ¥å¯ããã
- ãã®ä»ææ³çãªäºé
- ãããã«
- åè
è¦åºããå ã«æ¸ã
ç§ãæè¡è¨äºãæ¸ãã¨ãã«ã¯æåã«è¦åºãããæ¸ãå§ãã¾ããä¸è¨ã®ãããªæãã§ãã
è¦åºããå ã«æ¸ããã¨ã§ãæç« å ¨ä½ã®æ§æãææ¡ã§ãã¾ããã¢ã¦ãã©ã¤ã³ããæ¸ãã¨ãããã¤ã§ããã
ã¢ã¦ãã©ã¤ã³ãä½ããã«è¨äºãæ¸ãã¦ããã¨ãæç« å ¨ä½ã§ä¼ãããå 容ãã¶ãã¦ãã¦ãã¾ããã¨ãããã¾ããåãã«å¤§ã¾ããªæ§æãé ã®ä¸ã§ç·´ã£ã¦ãããå¿ããªããã¡ã«ä½ãæ¸ãããã®ãè¦åºãåãã¦ããããã«ãã¦ãã¾ãã
è¦åºããæ¸ãçµããããã®å 容ã«å¾ã£ã¦ç´°ããªæç« ãçµã¿ç«ã¦ã¦ããã¾ããè¨äºããããªãå ¨é¨æ¸ããã¨ããã®ã¯é£ããã®ã§ãè¦åºããã¨å°ããªã¹ãããã§é²ãã¦ãããã¨ã大åã§ãã
è¨äºå ¨ä½ã®æ§æã¯ä»¥ä¸ã®ãããªæãã«ãªãã¾ããè«æã§è¨ãã¨ããã®åºè«ã»æ¬è«ã»çµè«ã¨è¿ãæ§æã¨ãªã£ã¦ã¾ãã
- ã¯ããã«
- æ¬æ
- ãããã«
- åè
ãã¯ããã«ãã¯æåéãè¨äºã®åé ã«æ¸ãããæç« ã§ããããã®å 容ã¯ãªããã®è¨äºãæ¸ããã®ããã©ã®ãããªèª²é¡ãããã®ãã端çã«è¨è¿°ãã¾ããåºè«ã«è©²å½ããç®æã§ããã
ããã«çè ã®èªå·±ç´¹ä»ãæ¸ããã¦ãããã¨ãå¤ãã§ããã大æµã®æè¡è¨äºãæ稿ãããµã¤ãã§ã¯çè ã®ãããã£ã¼ã«ã¯ä»ã®ç®æããåç §ã§ããããã«ãªã£ã¦ãã¾ããåºæ¬çã«ã¯è¨äºã®å 容ã¨ã¯é¢ä¿ã®ãªãè£è¶³äºé ã®ãããªæ å ±ã¯ãã¾ãæ¸ããªãããã«ãã¦ãã¾ãã
ãæ¬æãã¯æ¬è«ã«è©²å½ããç®æã§ããå ã«è¿°ã¹ãè¦åºããå ¥ãã¨ããã§ããã
ããããã«ãï¼ãããã¯ãã¾ã¨ããï¼ã§ã¯è¨äºã®æ¬æä¸ã§è¿°ã¹ãå 容ãç°¡æ½ã«è¦ç´ãã¾ãããã®é¨åã ãèªãã§ãä½ãä¼ãããã£ãããããããã«ãã¦ããã¨è¯ãã§ããã
ã¾ããè¨äºã®æåã®æ¹ã«æ¸ããå 容ã¯ãããã¾ã§æ¥ãã¨ãã«ã¯å¿ãããã¦ãããã¨ãå¤ãã®ã§ãæ¹ãã¦æãåºãã¦ãããã¨ããå½¹å²ãããã¾ãã
ãåèãã«ã¯è¨äºãæ¸ãæã«åèã«ããè¨äºã®ãªã³ã¯ããªã¹ãå½¢å¼ã§è¨è¼ãã¾ããæè¡è¨äºãæ¸ãéã«ã¯ãªã«ãããã®èª¿ã¹ãã¨ããã¦ããã¯ãã§ããè¨äºãè¦ãã¿ã¤ãã³ã°ã§ãªã³ã¯ãã³ãã¼ãã¦ããã¨ãå¿ãããã¨ããªãã®ã§è¯ãã§ãããã
ä¸è¬çãªããã¼ã¨ãã¦åèæç®ã¯è¼ãã¦ããã¹ãã§ãããå¯æ¬¡çãªå¹æã¨ãã¦å¾ããèªåãè¦è¿ãæã«ä½ãå ã«æ¸ããã®ããããã®ã§éå®ãã¾ãã
ã³ã¼ãã¯å®è¡å¯è½ã«ãã
ã³ã¼ãã¯å®è¡å¯è½ã«ãããã¨ã¯èªè ãè¨äºä¸ã®ã³ã¼ããåçµãã¦å®è¡ã§ããç¶æ ã示ãã¾ããè¨æ¶ã«å®çãããããã«ãåçµãããªããè¨äºãèªã¿é²ããæ¹ãå¤ãããã£ããããã¨æãã¾ãï¼ç§ããã®1人ã§ãï¼ãåçµããã³ã¼ããå®è¡ã§ããªãã¨ãªãã¨ããã®æç¹ã§è¨äºãèªããã¨ãããããã¦ãã¾ãæããé«ãã§ãã
ã³ã¼ããå®è¡å¯è½ã«ããã¨ããç®çãéæããããã«ã以ä¸ã®è¦³ç¹ã«æ°ãã¤ãã¦ãã¾ãã
- ææ³ã¨ã©ã¼ããªãããã«
- æèä¾åã«ãªããªãããã«
foo
ãbar
ã®ãããªååã使ããããªã
ææ³ã¨ã©ã¼ããªãããã«
ææ³ã¨ã©ã¼ãããã³ã¼ãã¯å½ç¶å®è¡ã§ãã¾ãããã¨ãã«åå¦è ã¨ã£ã¦ã¯è¨äºã®å 容ãæªãã®ããèªåã®æ¸ãæ¹ãæªãã®ãå¤æãã¤ããªããã¨ãããã¾ã®ã§ãçµæã¨ãã¦èªè ã®æéã大ãã奪ã£ã¦ãã¾ãã¾ãã
è¨äºã®ç·¨éç»é¢ã«ç´æ¥ã³ã¼ããæ¸ãã¨ãææ³ã¨ã©ã¼ãåå¨ãã¦ãã¦ãè¦åãã¦ããã¾ããã VSCode ãªã©ã®ã¨ãã£ã¿ã«æ¸ãã¦ãããã¼ã¹ãããããã«ãã¦ãã¾ãã
ã¾ããå®éã«å®è¡ãã¦æ³å®ããçµæãå¾ãããã確èªããã¨ããã§ãããã
æèä¾åã«ãªããªãããã«
èªåãã³ã¼ããæ¸ãã¦ããã¨ãã«ã¯ãã½ã¼ã¹ã³ã¼ãã®å ¨ä½åãããã£ã¦ããã®ã§ã³ã¼ãã®æçã ãè¦ã¦ãå ¨ä½ã®ä¸ã§ã©ã®ãããªå½¹å²ãæããã¦ããã®ãããããã®ã§ãã
ããããè¨äºã®ä¸ã§ãããªãã³ã¼ãã®ä¸é¨åãåºã¦ããã¨ãªããã®ã³ã¼ããåºã¦ãã¦ãä½ããããã®ãåããã¥ãããã®ã§ããåæã¨ãªãæèããããªãã°ããã®é¨åã説æããã¦ããã¨ããã§ãããã
ä¾åãã¦ããã³ã¼ããè¨äºã®æ¬æ¨ã¨é¢ä¿ãªããã®ã§ããã°ããã®ç®æã¯æããããã§è¡¨ç¤ºã§ããããã«ããããã³ã¼ãã®å
¨ä½åã GitHub ã®ã¬ãã¸ããªã«è¼ãã¦ããã®ãããã§ããããä¾ãã°ã以ä¸ã®ããã«æªç¥ã®ã³ã¼ãã import
ããã¦ãããããã¨ãã®ã³ã¼ãã¯å®è¡ã§ããªããªã£ã¦ãã¾ãã¾ãã
import { useUsers } from './useUsers'; export const UserList = () => { // ãã® useUsers ã®å 容ã¯ã©ãï¼ const { users, loading } = useUsers(); return ( <ul> {users.map((user) => ( <li key={user.id}>{user.name}</li> ))} </ul> ); };
ã¾ãã1ã¤ã®ãã¡ã¤ã«ã®ä¸ã§ã³ã¼ãã®å 容ãé度ã«çç¥ããã¦ããã¨ã対象ã®ã³ã¼ããã©ã®ããã«æ¸ãã°ããã®ãåããã¥ãããªã£ã¦ãã¾ãã¾ããä¾ãã°1度ã³ã¼ãã®å ¨ä½ãè¨è¼ããå¾ã«ããã®å 容ã«å¤æ´ãå ãããããªã³ã¼ããæ¸ãæã«ããçºçãã¾ããã³ã¼ããå¤æ´ããé¨åã ãåãåºãã¦æ¸ãã¨ããã®å¤æ´ã¯ã©ãã«è¨è¿°ããã°ããã®ãä¸æçã«ãªããã¨ãå¤ãã§ãã
// ãã®ã³ã¼ãã¯ã©ãã«æ¸ãã°ããã®ï¼ <UserItem key={user.id} user={user} />
ãã®ãããªå ´åã«ã¯ã³ã¼ããå¤æ´ããç®æã®åå¾æ°è¡ç¨åº¦è¼ããdiff è¨æ³ã§æ¸ãã¨å¤æ´ç®æããããããããªãã¾ãã
import { useUsers } from './useUsers'; + import { UserItem } from './UserItem'; // çç¥... return ( <ul> {users.map((user) => ( - <li key={user.id}>{user.name}</li> + <UserItem key={user.id} user={user} /> ))} </ul> );
foo
ã bar
ã®ãããªååã使ããããªã
foo
ã bar
ã¨ã¯ããã³ã¼ãä¾ãåºãæã«å¤æ°ãé¢æ°åã«ç¹ã«æå³ã®ãªããã¨ã示ãããã«ä½¿ããããã®ã§ããä¾ãã°ãTypeScript ã®å注éã説æããã³ã¼ãå
ã§ä»¥ä¸ã®ããã«æ¸ãããããã¦ãã¾ãã
// é¢æ°ã®æ»ãå¤ã®åã¯å¼æ°ã®å¾ã« `:` ã§ã¢ããã¼ã·ã§ã³ãã¾ã const foo = (): string => { return 'bar' }
ç§ã¯ãã®ãããªæå³ã®ãªãååã使ããã¨ã¯ã§ããéãæ§ããå®éã«è¿ãã³ã¼ãä¾ãæ¸ãããã«ãã¦ãã¾ãããªããªããè¨äºä¸ã«ã³ã¼ããããã¯ãåºã¦ããã¨ãã¯å ·ä½ä¾ã示ããã¨ãç®çã ããã§ãã
è¨èªã®ææ³ãã³ã¼ãã®è¨è¨ã説æããéã«ã¯æ½è±¡çãªè«çã ã並ã¹ãã®ã§ã¯ãªãã説å¾åãä¸ããããã«å ·ä½ä¾ãåæã«è¨è¿°ãããã¯ãã§ãããã®éã«ä½¿ãããã®ãã³ã¼ããããã¯ã§ãã
foo
ã bar
ã®ãããªååã«ã¯å
·ä½æ§ãããã¾ãããå®éã«ä½¿ãããã³ã¼ãã«ã¯ãã®ãããªååã¯ä½¿ãããªãããã§ãã
foo
ã bar
ã®ååã¯ä½ãæè¡çãªææ¡ãè°è«ããã¦ãããããéã«ãäºç´°ãªç©äºã«æ³¨åãã¦ã»ãããªããããªå ´é¢ã§ä¾¡å¤ãããã¾ãã
è¨äºã¯1æ¥å¯ããã
è¨äºãæ¸ãä¸ãããããã«å ¬éãããæ°æã¡ã«ãªãã¾ãããããã§ãã£ã¨ãããã¾ããããå¿ ãæ¸ããæç« ã¯ã²ã¨éãè¦ç´ãããã¾ããä¾ãã°ã1ã¤ã®æãé·ããªãããã¦ããªããã表è¨ããããªããã©ããç´°ããç®æãè¦ç´ãã ãã§ãæç« å ¨ä½ãèªã¿ããããªã£ãããã¾ãã
ããã§éè¦ãªã®ã¯ã客観ç第ä¸è ã®è¦ç¹ã§è©ä¾¡ãããã¨ã§ããè¨äºãæ¸ãã¦ããã¨ãã«ã¯ãèªåã®é ã®ä¸ã ãã«ããåæç¥èãå ã«æ¸ããã¦ããããã¾ãã客観çã«è©ä¾¡ãããã¨ã§ãä»äººããè¦ã¦ç解ãã¥ããé¨åããããã表ç¾ã«å¤ãããã¨ãã§ãã¾ãã
第ä¸è ã®è¦ç¹ã§è©ä¾¡ããã«ã¯ã1æ¥å¯ããã¦å·éã«ãªã£ãé ã§è¦ç´ããããã¨ããã§ãããã1æ¥å¯ãã¨è¨äºãæ¸ãã¦ããæã®è¨æ¶ã¯èãã¦ããã®ã§ãè¨äºãæ¸ãã人ã¨ã¯ä»äººã®æ°åã«ãªãã¾ãã
ãã®ä»ææ³çãªäºé
ãã®ä»ãè¨äºãæ¸ãéã«æ³¨æãã¦ããç´°ããªææ³äºé ã§ããæç« å ¨ä½ã®èªã¿ãããã«å¤§ããé¢ä¿ãããã®ã§ã¯ãªãã§ãããèªåã¸ã®ã«ã¼ã«ã¨ããæ°æã¡ã§ãã£ã¦ãã¾ãã
- è¦åºãã¯
##
ããå§ãã - ã¤ã³ã©ã¤ã³ã³ã¼ããããã¯ã¯è£ 飾ç®çã§ä½¿ããªã
- è±èªã¨æ¥æ¬èªã®éã«åè§ã¹ãã¼ã¹ã空ãã
è¦åºã㯠##
ããå§ãã
æä¸ã®è¦åºã㯠##
ï¼ã¤ã¾ã <h2>
ï¼ããå§ããããã«ãã¦ãã¾ããã¾ããè¦åºãã¬ãã«ã¯é£ã°ããªãããã«ãã¾ãã
ããã¯æè¡è¨äºã®ææ³ä¸ã®ã«ã¼ã«ã¨ããããã¯ãHTML ã®è¦åºãã®ã«ã¼ã«ã«è¿ãã§ããã<h2>
ããå§ããã®ã¯ã¿ã¤ãã«ã <h1>
ã¿ã°ã§ããã¯ãã ããã§ãã
ã¤ã³ã©ã¤ã³ã³ã¼ããããã¯ã¯è£ 飾ç®çã§ä½¿ããªã
ã¤ã³ã©ã¤ã³ã³ã¼ãã使ç¨ããã¨ãèæ¯è²ãå¤æ´ããã¦å¼·èª¿ããããããªè¦ãç®ã«ãªãã¾ããï¼React
ã®ããã«ï¼
ã§ããã強調ãããç®çã§ä½¿ç¨ããã®æå³çã«ã¯èª¤ã£ã¦ãã¾ããHTML ã® <code>
è¦ç´ ã¯ãã³ã³ãã¥ã¼ã¿ã¼ã³ã¼ãã®çãæçã®æååã§ããã¨èå¥ã§ãããããªå¤è¦ã®ã³ã³ãã³ãã表示ãã¾ãã
https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-code-element
ã¾ããGoogle Chrome ã®ç¿»è¨³æ©è½ã¯ <code>
ã¿ã°ã®ä¸èº«ã翻訳ããªãããã«ãªã£ã¦ãã¾ããè£
飾ç®çã§ã¤ã³ã©ã¤ã³ã³ã¼ãã使ã£ã¦ããã¨ãå
容ãæ£ãã翻訳ãããªãæããããã¾ãã
è±èªã¨æ¥æ¬èªã®éã«åè§ã¹ãã¼ã¹ã空ãã
è±èªã¨æ¥æ¬èªã®éã«åè§ã¹ãã¼ã¹ã空ããã¨èªã¿ããã...ã¨è¨ããã¦ãã(?)ããã§ããçå½ã¯ä¸æã§ãããã®ã«ã¼ã«ã«é¢ãã¦ã¯ãã¯ãçã«ãªã£ã¦ãã®ã§ãç¹ã«æèããªãã§ãã£ã¦ãã¾ããã
ãããã«
以ä¸ãç§ãæè¡è¨äºãæ¸ãã¦ããæã«èãã¦ãããã¨ãè¨èã«ãã¦ã¿ã¾ãããç¹ã«ãå ã«è¦åºããæ¸ãã¦ã¢ã¦ãã©ã¤ã³ããèãããã¨ããé ãããåæããªããã¦èª°ãè¦ã¦ãåããããããªããã¨ãéè¦è¦ãã¦ãã¾ããæè¡è¨äºãæ¸ãéã«èãããã¨ã¯æ§ã ã§ã¯ããã¾ãããå°ãã§ãåèã«ãªãã¨å¹¸ãã§ãã
åè
- ã¢ã¦ãã©ã¤ã³æèæ³ åºæ¬ç·¨ å¹ççã«æç« ã»ã¹ã©ã¤ãè³æãä½ãæ¹æ³âLui Yoshida Lab
- ã¬ãã¼ãã»è«æã®æ¸ãæ¹
- ãªãããã°ã©ã ã®ä¾ã§ç¡æå³ãªãfooãããbarãããbazãã好ãã§ä½¿ã人ãå¤ãã®ã§ããããï¼ãã£ã¨æ¦å¿µã説æãããæå³ããååã«ãã¹ãã§ã¯ãªãã§ãããããæµè¡ããä½ãã§ããï¼ - Quora
- åå¿è Webã©ã¤ã¿ã¼ã®è¨äºå稿è¦ç´ããã§ãã¯ãã¤ã³ã4㤠| æ ªå¼ä¼ç¤¾LIG(ãªã°)ï½DXæ¯æ´ã»ã·ã¹ãã éçºã»Webå¶ä½