1"use strict";(self.webpackChunktechnical_writing=self.webpackChunktechnical_writing||[]).push([["422"],{5389:function(e,t,n){n.r(t),n.d(t,{default:()=>a});let a={howToGuideDocExample:{content:{code:`# Reactìì ìë ì¬ìë ê¸°ë¥ íµí© ê°ì´ë 2 3ìë ì¬ìë ë¡ì§ì React ì»´í¬ëí¸ì íµí©íì¬ API ìì² ì¤í¨ ì ìëì¼ë¡ ì¬ìëíë 기ë¥ì 구ííë ë°©ë²ì ìë ¤ëë ¤ì. 4 5ì´ ê¸°ë¥ì¼ë¡ ë¤í¸ìí¬ ë¶ìì ìí©ììë ìì ì ì¸ ë°ì´í° ìì²ì ë³´ì¥íì¬ ì¬ì©ì ê²½íì ê°ì í ì ìì´ì. 6 7## UI 구íí기 8 9ë¤ì ìì ë ìë ì¬ìë ë¡ì§ì íì©í´ API ë°ì´í°ë¥¼ ë¶ë¬ì¤ê³ , ë¡ë© ìíì ì¤ë¥ ì²ë¦¬ë¥¼ í¬í¨í UI를 구ííë ì½ëì ëë¤. 10 11\`\`\`jsx 12import { useEffect, useState } from "react"; 13 14function App() { 15 const [data, setData] = useState(null); 16 const [error, setError] = useState(null); 17 const [loading, setLoading] = useState(true); 18 19 useEffect(() => { 20 fetchWithRetry("https://jsonplaceholder.typicode.com/todos/1", {}, 3, 1000) 21 .then(json => { 22 setData(json); 23 setLoading(false); 24 }) 25 .catch(err => { 26 setError(err.message); 27 setLoading(false); 28 }); 29 }, []); 30 31 return ( 32 <div> 33 {loading ? ( 34 <p>ë°ì´í° ë¡ë© ì¤...</p> 35 ) : error ? ( 36 <p style={{ color: "red" }}>{error}</p> 37 ) : ( 38 <div> 39 <h2>API ë°ì´í°</h2> 40 <pre>{JSON.stringify(data, null, 2)}</pre> 41 </div> 42 )} 43 </div> 44 ); 45} 46 47export default App; 48\`\`\` 49`,sections:[{explanation:"ì´ ë¬¸ìì 목íì íê² ë ì를 ëª íí ì ìíì´ì. ì´ ê°ì´ëë 'ìë ì¬ìë ê¸°ë¥ êµ¬í'ì´ë¼ë 구체ì ì¸ ê³¼ì ì ì´ì ì ëê³ ìì¼ë©°, ë¤í¸ìí¬ ë¶ìì ìí©ììë ìì ì ì¸ ë°ì´í° ìì²ì´ ê°ë¥í ì í리ì¼ì´ì ì ë§ëë ê²ì´ ìµì¢ 목íì ëë¤. ë ìë ì´ ë¬¸ì를 íµí´ í´ë¹ 기ë¥ì 구í ë°©ë²ë¿ë§ ìëë¼, 구íì íìì±ê³¼ í¨ê³¼ì ëí´ìë ì´í´í ì ììµëë¤.",lineStart:3,lineEnd:5},{explanation:"ìë ì¬ìë ë¡ì§(`fetchWithRetry`)ì íì©í´ API ë°ì´í°ë¥¼ ìì ì ì¼ë¡ ìì²íê³ ê·¸ 결과를 ìí(state)ì ë°ìíë ë°©ë²ì ìì¸í ìë ¤ì¤ì.",lineStart:9,lineEnd:48}]}},troubleShootingDocExample:{content:{code:`# "Module not found: Can't resolve 'react'" ìë¬ í´ê²° ê°ì´ë 50 51"Module not found: Can't resolve 'react'" ìë¬ê° ë°ìíì ë í´ê²° ë°©ë²ì ìë ¤ëë ¤ì. 52 53## 1. í¨í¤ì§ ì¤ì¹ ì¬ë¶ íì¸ 54 55ì´ ìë¬ë React í¨í¤ì§ê° ì¤ì¹ëì´ ìì§ ìê±°ë, \`node_modules\` ëë í 리 ë´ì í´ë¹ 모ëì´ ì¡´ì¬íì§ ìì ë ë°ìí©ëë¤. 56í°ë¯¸ëìì ìë ëª ë ¹ì´ë¥¼ ì¤ííì¬ React í¨í¤ì§ê° ì¤ì¹ëì´ ìëì§ íì¸íì¸ì. 57 58\`\`\`bash 59npm list react 60\`\`\` 61 62## 2. í¨í¤ì§ ì¬ì¤ì¹ ë° íê²½ ì ê² 63 64문ì ê° ê³ìëë¤ë©´, React ë° React-DOM í¨í¤ì§ë¥¼ ì¬ì¤ì¹í´ ë³´ì¸ì. 65 66\`node_modules\` ëë í 리ì \`package-lock.json\` íì¼ì ìì í í ë¤ì ì¤ì¹íë©´, íê²½ ê´ë ¨ 문ì ê° í´ê²°ë ê°ë¥ì±ì´ ëìµëë¤. 67 68\`\`\`bash 69# React ë° React-DOM ì¬ì¤ì¹ 70npm install react react-dom 71 72# ëë, ì¬ì¤ì¹ ì ì°¨: 73rm -rf node_modules package-lock.json 74npm install 75 76# ì´í íë¡ì í¸ ì¤í 77npm start 78\`\`\` 79 80## 3. [ì í] Node.js ë²ì íì¸ ë° ì¡°ì 81 82Node.js ë²ì ì´ í¸íëì§ ìë ê²½ì°ìë ì´ ìë¬ê° ë°ìí ì ìì´ì. íì¬ Node.js ë²ì ì íì¸íê³ , íìíë¤ë©´ í¸íëë ë²ì ì¼ë¡ ì ííì¸ì. 83 84\`\`\`bash 85node -v 86nvm use 18 87\`\`\` 88`,sections:[{explanation:"첫 ë²ì§¸ ë¨ê³ìì 문ì ì ê°ì¥ 기본ì ì¸ ìì¸ì ì ìíê² ì§ë¨í ì ìëë¡ ìë´í´ì ë¹ ë¥´ê² ë¬¸ì 를 í´ê²°í ì ìëë¡ ëìì¤ì.",lineStart:5,lineEnd:12},{explanation:"ë¤ë¥¸ í´ê²° ë°©ë²ë ì ìí´ì í´ê²° ê°ë¥ì±ì ëì¬ì. ë, `npm start`를 ì¤ííë ë¨ê³ë¥¼ í¬í¨íì¬ ìµì¢ ì ì¼ë¡ 문ì ê° í´ê²°ëìëì§ íì¸í ì ìëë¡ êµ¬ì±íì´ì.",lineStart:14,lineEnd:30}]}}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.